Working with Webtable

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:

@ran.ferdinaro

Should i need to follow these many steps to identify by my row?

  1. Get the total count
  2. for every row until total count
  3. Add step to get the text value of a attribute
    if doesn’t matches
    continue loop
    else exit
  4. Get the current rownumber
  5. 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.

@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.

@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

@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 :frowning:


Element must have 'table' tag! at Actions.Utils.getTableElement(Utils.java:17)