cancel
Showing results for 
Search instead for 
Did you mean: 

Condition based checkbox clicking within a Table on a HTML page

HemantKumar_Sin
Level 2
Hi Folks, I have a tabular data on a website say in the format: Column 1 Column 2 Column 3 checkbox1 Name1 data1 checkbox2 Name2 data2 checkbox3 Name3 data3 and so on... Each row in "Column 1" is a checkbox. I want to put a loop around the values in "Column 2" and want to click the checkbox depending on required value in column 2. Ex: Say, I want to click on the checkbox1 for "Name1" and then checkbox3 "Name3". Any help, hint, suggestions would be greatly helpful. Can the checkboxes be recognized by title/name? Waiting for responses ASAP. Regards hks
2 REPLIES 2

Anonymous
Not applicable
Hi hks, I can share with you what I usually do in this situation: Spy the first cell in your table and find the path from the attributes list. This will most likely reveal a path which ends with ""....TD(1)/TR(1)"". Copy this path into a data item and change the row and column identifiers in the path to something unique, e.g. to a path called ""...TD(XXX)/TR(YYY)"". Next, create a new element in your application modeller, where you once again spy a cell in your table - but set the path to be dynamic (and make sure to disable any attribute linked to the contents of the table). Now, you can create a read stage which reads from your now ""dynamic cell"" - and the attribute that has to be input to this stage will be the data item with the path. Create a counter (or in this case two), and use Replace([path], YYY, [counter]) as input to the read-stage. The rest will of course just be setting up the logic on the page. I hope that my explanation makes sense.:)

ShreyansNahar
Level 5
When you spy the check boxes using the AA mode, you can get the details of the attributes. While looping on the values in Column2, using dynamic Xpath (using HTML spying mode) or any other dynamic attributes (using AA spying mode) will help to get the row number/location of match and then you can put conditions on how you want to proceed further basis the condition.