How to process web page to click on the right button?

There is a webpage (below), where there are multiple edit buttons in a table. I want to match Number field with a variable (I am reading data from an excel sheet and storing it in a DT) and click on that specific edit button. Below screen shot for reference:

For example, I want to look for TR000112 and click on the second EDIT button. Is that possible? How can I do it?

Please take the edit selectors and look at the part which is changing and make it dynamic.

Regards,
Karthik Byggari

I am new to UI Path and not able to understand completely your suggestion. Can you please elaborate? Thanks
Here is the HTML for the page:

<tbody><tr>
    <th class="col1">&nbsp;</th>
    <th class="col2">Number</th>
    <th class="col3">Title</th>
    <th class="col4">Status</th>
    <th class="col5">Status Date</th>
    <th class="col6">Change Status</th>
</tr>
<tr valign="top">
    <td>
        <a href="projectinfo.taf?Z01=112913"><font color="red">Edit</font></a>
    </td>
    <td>
        TR000110-06
    </td>
    <td>qHTS to Identify Activators and Inhibitors of Wip1</td>
    <td>
        <font color="red">Pending</font>
    </td>
    <td nowrap=""></td>
    <td nowrap="">
        <a href="changeStatus.taf?change2=inactivate" class="lnks">Inactivate</a>
        |
        <a href="changeStatus.taf?change2=terminate" class="lnks">Terminate</a>
    </td>
</tr><tr valign="top">
    <td>
        <a href="projectinfo.taf?Z01=103466&"><font color="red">Edit</font></a>
    </td>
    <td>
        TR000112-04
    </td>
    <td>qHTS to Identify Molecular Activators and Inhibitors of Tyrosinase</td>
    <td>
        <font color="red">Pending</font>
    </td>
    <td nowrap=""></td>
    <td nowrap="">
        <a href="changeStatus.taf?change2=inactivate" class="lnks">Inactivate</a>
        |
        <a href="changeStatus.taf?change2=terminate" class="lnks">Terminate</a>
    </td>
</tr></tbody>

@Ozair_Sajid

  1. Drag-drop the Click activity into design screen
  2. Click on “Indicate on screen” text of that click activity
  3. Click on any “Edit” link on your website
  4. Copy & Paste here the content of Target > Selector property of Click activity

Base on your shared content, we will give you suggestion to customize the selector to adapt your requirement

You should use Anchor Base activity and first point to the TR000112 cell and then to the edit link, this will work well for your case.

Sorry for the late reply. We had some license issue and could not get studio to work.
Here is the selector property

<html app='chrome.exe' title='NIDB Annual Reports' />
<webctrl aaname='Edit' tableRow='3' tag='FONT' />

With above it clicks the Edit button on the second row next to ‘TR000112-04’. I want to make it dynamic by first searching for TR000112-04 in the entire table and then click on the Edit button next to it.
@bcorrea I tried Anchor base but could not get it to work.

Here is a snapshot of the anchor base activity that I added.

  1. For Find Text Position: I have selected the entire table and set the Text to equal to “TR000112-04” for testing. UiElement is empty - let me know if that needs to be set (was not able to find an example for this activity on uipath documentation).
  2. For Click activity - I selected one of the Edit button and removed tableRow from the selector to make it generic.

With this setup I am getting error - Anchor Base: The method or operation is not implemented.
Any idea?

You can try to use Data Scrapping to get all data and save to a datatable
With Edit column, you need to get both the Text and the Link of item
-> Use that datatable variable, you can search your item, them build the link dynamic

Thanks. Let me try that.

@Ozair_Sajid
Anchor based selection work, but i would suggest the to do it within the UiExplorer (Fully expanded where you can inspect visual tree and Properties on left side)

  • Let select the Edit button
  • Loacate the anchor in the visual tree, do right click on it and do Select as anchor Or Use indicate Anchor
  • You will see something like nav up=‘x’ syntax between Anchor and Target
  • Now modify the anchor selector by taking any ID information in and make it dynamic with a variable

We can help you more on it once you share a relevant screenshot from UiExplorer content with us

@ppr Here is the screen shot from the UI explorer.

Which activities to select under anchor base activity for action and anchor? Thanks in advance.

Please copy us the selector text from screenshot as text here. Ensure you have formatted as Code use this buttongrafik for this

<html app='chrome.exe' title='NIDB Annual Reports' />
<webctrl tag='TABLE' />
<webctrl isleaf='1' tableCol='2' tableRow='3' tag='TD' />
<nav up='1' />
<webctrl aaname='Edit' tableRow='3' tag='FONT' />

@ppr Here is the selector text.

@Ozair_Sajid
Ensure that you are using or do this test on a fresh one. Instead of selecting an element giv a try on following selector

<html app='chrome.exe' title='NIDB Annual Reports' />
<webctrl tag='TABLE' />
<webctrl isleaf='1' tableCol='2' innertext='TR000110-06' tag='TD' />
<nav up='1' />
<webctrl aaname='Edit'  tag='FONT' innertext='Edit' />

the logic behind is

  • dont bind any row index
  • bind it on td element with the id info
  • go up 1 element (nav up tag)
  • click on span with the text edit

Maybe this works on the first try. Otherwise we will rework on it. Lazter we do it dynamize it that the idinfo can be a variable and we can alick on an idinfo’s edit

Let us know your feedback

1 Like

@ppr Thanks. Which activities to use for Anchor Base?. After I open UI Explorer from the top toolbar and configure it just like you have indicated. Whats the next step?

@ppr So I was getting confused with Anchor base activity. Instead of Anchor base activity I used a click activity and using UI explorer I selected the anchor and configured it according to your suggestion, saved it and it worked. Thanks

Now, how to make it dynamic by using the a variable. I am reading the data from an excel file.

@Ozair_Sajid
Cool IT IS working. For next step have a Look Here
How to use variables in selectors in Studio (dynamic selectors) without string manipulation!

@ppr I had to use wild card with the variable and it worked. Appreciate all your help!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.