0 votes
How to get the tag control under one td[]?

for example:

control_under_TD_Query = "table[1]/tbody[1]/tr[2]/td[2]/descendant::input"

control_under_TD = Browser(Browser).performXpathQuery(control_under_TD_Query)

println control_under_TD(1)

I know the answer is a <CheckBox> or <EditBox> or some tag name,


BUT the question is sometime I don`t know the what to put after the "table[1]/tbody[1]/tr[2]/td[2]/descendant:: ????????"

I want to know what underneath the td. I don`t know the content of "????????". what to do then??

is there an input[] tag or a select[] tag or a span[] or both or all of them?

if the TD[] tag has input[], or a combo like span[] and input[], can I know how many input[] and span tags and get their full element path during playback?

I want the answers output  like the following

the TD has 2  <span>(s),  1 <input>, '

span[1] path: table[1]/tbody[1]/tr[2]/td[2]/span[1]

span[2] path : table[1]/tbody[1]/tr[2]/td[2]/span[2]

 Input[1]path: table[1]/tbody[1]/tr[2]/td[2]/input[1]

is that too hard?  Sorry, It is kind of challenging I think, remeber we don`t know the content of underneath the table,  maybe a <select> or <a>  . Also, all are need to be done during playback. No Manually check are supposed to involved.

this is not easy ... have a try

Thanks Brilliant!
asked Mar 29, 2016 in QA Wizard Pro by Leo (230 points)

1 Answer

0 votes
Do you know the ID or CLASS of the item in the cell / TD..?

Would you like to locate the type of control / input in the cell and then perform an action on it..?
answered Mar 30, 2016 by nico (8,200 points)
Unfortunately, the ID and [class],  and tag names are unknown, that is why I say this is challenging. But I know it could be a span, input[], select[], a[], or even a table or nothing underneath the cell, etc. All I need is type of elements and its path,  just one level deepper below the known cell path.

As for your assumption, that is correct, once types of controls are detected underneath the target cell, the script can capture them and perform actions during playback. (Not pre-capture)

 Does .net regex can be some help here?

Thank you again for taking this challenge!
248 questions
262 answers
2,047 users