For example we have 2 pages some of the filtered rows are in page1 & some in page 2.first it has to select checkbox in page 1 & then go to page 2 & select check box if filtered rows present.
How can we achieve that?
you can achieve this task by using the following steps:
- Use the “Data Scraping” wizard to extract the data from the first page. This will create a data table variable with the extracted rows.
- Use the “For Each Row” activity to loop through each row in the data table.
- Inside the loop, use an “If” activity to check if the filtered condition is met for the current row. If it is, then use the “Click” activity to select the checkbox on the first page.
- After the loop completes, navigate to the second page.
- Again, use the “Data Scraping” wizard to extract the data from the second page. This will create a new data table variable with the extracted rows.
- Use another “For Each Row” activity to loop through each row in the second data table.
- Inside this loop, use an “If” activity to check if the filtered condition is met for the current row. If it is, then use the “Click” activity to select the checkbox on the second page.
Thanks!!
tried that way but pages can be different sometimes it can be 1 or 2 or 5.Using extraction I extracted multiple pages & stored in data table1. Used filter data table & stored filtered data in another data table i.e filteredDataTable. Then checking for each row in datatable1
if datatable1.rows(rowindex)(“column1”).tostring=filteredDataTable.rows(rowIndex)(“column2”).tostring
getting row index to select checkbox.
but here not getting how to switch to different pages to select checkbox
Assuming there is a fixed number of max items per page:
- Extract the entire table over multiple pages as you did.
- return to page one if needed.
- For each row in datatable.
- Keep track of your row index by using the index parameter of the for each
- if the item needs a check, check it.
- if index > max items/page → click next page and reset the index variable (new page, count from 0 again)
how to reset row index to 0 for new page. Can you share sample
In 2nd page I am getting row Index as 22 as per extracted data table for multiple pages. In 2nd page it has to select one checkbox i.e row index is 6 but as it is fetching 22 selector error coming
how can we reset index variable for page 2 please help
Techically you don’t.
Create a second variable instead of the loop index, incement that one each loopcycle, and set it back to 0 if it gets bigger than the # items per page
Assume: max rows / page = 10 → i_MaxRows = 10
Each loop:
- assign i_MyIndex = i_MyIndex + 1
- if i_Myindex > i_MaxRows then assign i_MyIndex =0 (or =1 depending on your settings)