I created a script using an extracted DataTable, a For Loop and an If Statement. Process flow below:
- Extract a table of 6 columns
- Iterate through every row and find the keyword ‘DHL’ or ‘FEDEX’ on column 2
- If the keyword ‘DHL’ or ‘FEDEX’ exists (for example, Row 3), use this row number 3 and
- Click on the word ‘View’ located in column 1
Step 1,2,3 is working perfectly. However, the script is now forgetting to click on Row 3, but keeps on going to click Row 1 (incorrect) instead.
Since View the target is the same throughout the table how can I click on the correct View in the correct row?
Please make your selector dynamic in click activity by making use of row number as a variable in your selector.
Hope this works for you.
Better use for each ui element activity directly…which provides you with filters as well
Else follow as @Hari_Prakash specified
Hi. I’ve made my selector dynamic. But how can i make use of the row number as a variable within my selector?
I’ve saved my row index variable as - CurrentRowIndex.
In place of
or open selector in the click activity and right click on number 1 and select the variable you need
I’m using the variable but it’s still repeatedly pressing the same first button
Can you indicate the first row and the second row and check if the tablerow is the only difference you see or is there anythign else
Also better remove the css selector for the table
I’ve removed the entire CSS selector line but it’s still the same. Yes I believe the only difference is the tablerow
Can you print the currentrowindex and see if it is incrementing
Are you usign strict selector only or fuzzy?
can you show the click properties please
I think I’m using both? There’s value in both selectors
Oh I realised I didn’t check the use “Strict Selector”. It’s sort of working now…
There are 5 different rows, 5 different links. But the first 2 is opening the same no.1 link while the rest are proper. Should i unselect the fuzzy selector?
Yes plase you can use only strict
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.