I value matches with variable click link in another column

Hi , I have a scenario, where there is a table in a webpage with multiple pages.

I have scraped table from web from all pages(number of pages dynamic).

based on a value in a variable matching a value in 3rd column , it should click on a link in the 4th column.

ex:

column1 column2 column3 column4
01 ABCD AA-234 Select
02 PQR AA-123 Select
03 WWW AA-789 Select

Variable value is “AA-123”, so I should click on Select from Second row…

Thanks…

If value is not in the list it will continue on clicking next page as next page button is not disabled…
Please help me on this, how to comeout of the loop.

are you extracting table for same reason or you have any other requirement

First spy the column cell which you have value then make the that dynamic by giving the value Mostly it should be “aaname” ,
also the target cell as you mention like “select” with dynamic attribute table row

Also spy next button element as you are referring it as multiple pages are present

Next step use element exists for cell value you have , if present use get attribute activity to get the table row , which is input for select element

use click activity inputting the select element

if in the element exists activity for column cell is not found ,
use element exist for next button if this is not present then steps required as per business flow

if next button exists , use click activity to click on next page
after that above steps repeats

Hope i did not confuse

Thanks, but I didnt understand,

@MEGHA_cs

Please check this…its a similar scenario

If you have multiple pages then do this in a loop with click on next button

Hope this helps

Cheers

Thanks,’
In get attribute ,i should get table row number right?

in click activity, i should use corresponding table row number?
is that correct

@MEGHA_cs
Yes exactly…thats the idea…tablecolumn will control the column to access

Cheers

Thanks,

But in get attribute, if I use variable for innertext, am getting error.

@MEGHA_cs

Can you show the error please…you can right click on the innertext value in selector and select a variable from the options

Cheers

am getting this

1 Like

@MEGHA_cs

This is not how you add a variable either right click and select the variable on the selector or use {{variablename}}

Cheers


with this also am getting error

@MEGHA_cs

Please remove table row properly…and give a default value is strvalue and valudate and check…tablerow shpuld be removed from the selector

Cheers

Ok, I need to check in each page for the value right?
check in 1st page ->not found->go to next page. right?

how to loop through each page as page number is dynamic

@MEGHA_cs

Is there a next button?

Your steps will be as follows

  1. Do while
  2. Element exists for required row(selector with innertext variable)
  3. If condition then side use get attribute and then click .
  4. On else side…one more element exists for next button…then if condition with then side click on it and on else side break the loop

Condition of while can be true directly and make sure to include a max iteration number

Cheers

Thaks!!
next button is here


…

How to get number of pages as it is dynamic.

@MEGHA_cs

I believe next button is disabled after reaching the max page right?

If not first do a get attribute on the showing pages x of x and then we can extract the last number pth to know the number and do for those many clicks max

Cheers

yes, Next button is disabled…
how to proceed, if next button is disabled it will give error in click when in last page?

@MEGHA_cs

That is why before click we have an element exists for click also…and only when it is there we are clicking else break the loop

Cheers

Next button will be there in last page but it will be disabled,
on Element exists for next button in last page it will b true , only when it tries to click will get error right?

correct me if I am wrong