Reading Data from a Web table and checking boxes

Hello forum community,

Need your help. I am stuck with an activity - I want to read a table from a website, check the cell of a particular column and based on that reading, I want to tick a check box in that row and reiterate this for the whole. This table is dynamic, i.e. number of rows change every time. I am experimenting with find children/descendants but haven’t been able to find a solution.

thanks

Hi,

Is the web site on Internet? If so, can you share the URL?

Regards,

Unfortunately it can’t be accessed without a username and password.

Hi,

Alright. Can you try the following steps?

First, launch UiExplore and select target item (such as test to read or checkbox)

Then, we can see attributes which we can choose, as the following.

img20210903-1

There are some helpful attribute to identify item in table : colName, tableCol, rowName and tableRow.

Probably we can get the text and check checkbox in order by increment tableRow.

If we need to know number of rows in advance, DataScraping will be helpful.

Regards,

thank you, I used UiExplorer to identify the columns. Also used help from this link for using Assign and Get Attribute but the checkbox condition in the while loop is not working - the difference between this sample and my work that I have to select multiple rows: Enabling a checkbox based on text - #7 by Andrew_Callaghan



This is what I have done. But its still not working

I tried putting in a opposite if condition, and put the checkbox within if condition, but didnt execute.

Hi @Hammad

Can you please show the website you are automating and have you changed the selectors according to your process

Thanks

Hi @prasath_S thank you for replying. Yes, I have changed the selectors (used the UIexplorer path from the required table).

do you want to see the table (and how its structured?) or the website (because the website can’t be accessed without credentials)

@Hammad indicate anything in the website table using Uiexplorer and show the selectors.

Thanks

this is what I have chosen:

Hi @Hammad

Please try these steps,

  1. Put an message box after get attribute and check if the value is coming correctly.

  2. In the if condition it should be strText = status1

  3. And also have you changed the column number in the selector before check activity.because the column 8 is where status is present but for check box you have to change the column number accordingly.

Thanks

Hi @prasath_S. thank you for helping.

  1. The message box works
  2. I have tried putting an = sign for if condition, but its not working. that being said, since I am breaking if the condition is met, shouldn’t it be “not equal to” for it to continue? note that I have to check all the checkboxes that meet the requirement.
  3. I have changed the column number (to 1 in my case) but I haven’t used the UIexplorer again (just copied the same address and changed the column number to 1) hope thats not the reason for error. Also, I have used the same variable “strSelector” for checkbox (after while loop) and text column (before while loop), would it be advisable to use a different variable?

Regards

@Hammad do you have to check all the check box with the status not equal to “ammed by origin”

And yes check activity works only if you have correct selectors.so yes column number might be a problem,could you please indicate the check box using Uiexplorer and show the selectors.

Thanks

I have to check all the check boxes where status is “Ammended by Originator”


this is the error i am getting

error on checkbox

Please try these,

  1. Take the check activity and assign activity before that and put that on the then part of if activity.

  2. Condition for if activity is strText = Status1

  3. Delete the break activity as we don’t to need to break the loop.

  4. If check activity won’t work replace it with the click activity with the same selector.

  5. Put a message box and pass strSelector and check if the row number is incrementing correctly.

And don’t use idx if it’s more that 1.

Thanks

Hi @prasath_S thank you the program has started ticking checkboxes but its skipping some boxes (first 2 and then 5 in the middle)

I made the changes you asked, caught another error in my code (after the rowNumber editor +1, my selector code was incorrect).

Now the only concern is that it selects all of them where the condition is met.

Can you show the error and also what is in the 2nd and 5th row.

And also show the screenshots of the workflow of what you have done.

Thanks

The error that I mentioned is resolved. There are 21 rows in total (all with same status “ammended by origin”), the count (using message box) only goes to 17 by skipping 4 rows in the middle (not the 4th, but 4 rows). For the first 2 rows, while it counts them but only starts checking from row 3.

Below is the error, this is probably because it does not have more rows to go to, i will manage this using break in else. do you think that will solve it?

This is whats within my while loop.

@Hammad let’s try to solve this one by one so it may not be difficult,

  1. So you say there are 21 rows in total with the status “ammeded by origin” but it is showing error in 18 th row itself ,is the other rows in the same page or in the next page and also could you Indicate the 18th row manually and see what selectors are coming

  2. It’s skips forst 2 rows - put an message box in else of the if activity and check if it’s coming as “ammended by origin”

  3. In condition put strText.trim.toupper = status1.trim toupper

And also of possible share some more screenshots of the application you are using and some more of workflow with the starting and ending part as well as it is difficult to understand the problem from the provided screenshots.

Thanks