Test
April 18, 2022, 10:25am
#1
Kudos to the technical team that provides multiple updates.
We are having trouble in working with web tables, below is the situation we are trying to achieve.
N rows fixed columns in the given table, 1st column is the key and clickable link is having same attributes for all the rows.
Need traverse thru the rows find the row number using the key column and perform the click on the corresponding link column.
Any help is appreciated, explanation video is much helpful.
Thanks.
Hi @Test ,
The best solution would probably be to use Xpath.
Compare the difference in the Xpaths between rows and columns to know what you need to change in each Xpath to reach the right row and column.
Then, you can use any of these articles to help you achieve that goal:
Test
April 18, 2022, 1:06pm
#3
@ran.ferdinaro
Should i need to follow these many steps to identify by my row?
Get the total count
for every row until total count
Add step to get the text value of a attribute
if doesn’t matches
continue loop
else exit
Get the current rownumber
perform click on another column for this row number
This is much hectic, is there any easy plugin to achieve this?
Like to evaluate Xpath regular expression to row number?
//tr[text()=‘Search Text ’]/td[1]/a
is there a way to exit the loop?
@Test
Your steps are correct.
You can change the settings for every step or groped steps as a test in the advanced options.
Also, you can use the ‘Count Elements’ action with a more ‘general’ xPath (which contains the rows/columns) to evaluate how many rows/columns are there.
Test
April 18, 2022, 1:17pm
#5
@ran.ferdinaro
Usually below expression supposed to give exact row number
//tr[text()=‘ Search Text ’]/td[1]/a
td[1] specifies the column as target, by keeping that as reference row is supposed to be returned.
So that I don’t have to do multiple steps though to get the row number
is there any community plugin for that?
Using the ‘Count Elements’ action should help you.
Also, the recorder can show you the xPath in the attributes section.
Test
April 18, 2022, 1:58pm
#7
@ran.ferdinaro
HTML Table Actions helped me here
ACTION: Search Text
Input: Xpath of the Table
**Output**: row and column presence of the search Text
I have suggestion for this plugin, where should i post?
In my case, I already know which Column i am looking for the data,
* Taking column as input and returns the row number
* Takes row as input and returns the column number.
Thanks Team for this plugin
Thanks for the suggestion, I will let you know if this is added to the roadmap.
1 Like
Test
April 18, 2022, 4:17pm
#9
@ran.ferdinaro
I was able to find an workaround for this now, by giving single column as table.
Please ignore this, developer was expecting xpath of a table
Element must have 'table' tag! at Actions.Utils.getTableElement(Utils.java:17)