WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 7:44am
1
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?
Hi,
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.
Thanks
Anil_G
(Anil Gorthi)
May 29, 2023, 7:54am
3
@WilfredNg
Better use for each ui element activity directly…which provides you with filters as well
Else follow as @Hari_Prakash specified
cheers
WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 8:10am
4
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.
Anil_G
(Anil Gorthi)
May 29, 2023, 8:12am
5
@Hari_Prakash
In place of tablerow='1'
use tablerow='{{rownumbervar}}'
or open selector in the click activity and right click on number 1 and select the variable you need
cheers
WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 8:31am
7
I’m using the variable but it’s still repeatedly pressing the same first button
Anil_G
(Anil Gorthi)
May 29, 2023, 8:39am
8
@WilfredNg
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
Cheers
WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 9:31am
9
I’ve removed the entire CSS selector line but it’s still the same. Yes I believe the only difference is the tablerow
Anil_G
(Anil Gorthi)
May 29, 2023, 9:36am
10
@WilfredNg
Can you print the currentrowindex and see if it is incrementing
cheers
Anil_G
(Anil Gorthi)
May 29, 2023, 9:47am
12
@WilfredNg
Are you usign strict selector only or fuzzy?
can you show the click properties please
cheers
WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 9:54am
13
I think I’m using both? There’s value in both selectors
WilfredNg
(Ng, Wilfred (uig00609))
May 29, 2023, 10:05am
14
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?
Anil_G
(Anil Gorthi)
May 29, 2023, 10:09am
15
@WilfredNg
Yes plase you can use only strict
Cheers
system
(system)
Closed
June 1, 2023, 10:09am
16
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.