Pega RPA Cannot capture hyperlink properly from a table in a web adapter
I have a requirement to click a hyperlink within the last column of a table. I interrogated the table using HTML Table Designer, and I am trying to interrogate the hyperlink using Select Element. However, after interrogating the hyperlink it does not show up under the table I interrogated. The link does show up, but it appears outside of the table. Could someone tell me what I may be doing wrong?
In the screen shot attached, the table is tblDefendant_Results, and the link is lnkPrint_Preview.
***Edited by Moderator Marissa to update Platform Capability tags****
In my experience, if you have already setup the HTML table, then interrogating any controls within a row will automatically place them within the row object. If you interrogate the hyperlink first, then obviously that wouldn't happen (likely). I suspect though that either the link isn't within the table, or there's something else going on.
If possible, can you include a screenshot of the form that appears when you interrogate the control using Select Element? Also, are you able to show a screenshot of the page? Be sure to blue or otherwise obfuscate any proprietary data from any screenshots. For the select element, I really just want to confirm that the hyperlink is within the table. For the screenshot of the page, it just makes it easier to understand.
Thank you for the timely response! I am trying to interrogate the hyperlink after I have interrogated the table itself. I am only able to take a screen shot of the final column of the table, but you can see that the hyperlink is within the table. I have also attached the Select Element window that appears after dragging the target over the hyperlink.
Whenever I have had this problem in the past, I have had to manually move the control under the row hierarchy within the OS file. This isn't terribly difficult, but you'll likely want some assistance. I would suggest opening a support request as they might be able to identify why it isn't parenting appropriately. If you do want to move it within the XML, just be sure to back up your OS file before editing it (and close the solution in Studio before you edit).
You would edit the OS file (it is XML) and simply move the node that contains the control. I prefer to use a program called XML Notepad 2007 as it is the easiest one I have found to edit the XML. If you can post your adapter's OS file here, I could move it for you. Here is an example. Controls are always located under a Content\Items node.
If your link is beneath your table row, then when you connect it to your automation, you should see a key fitting appear where you specify either the key or the index. This might be inherited further upstream in your automation from wherever you first referenced anything within a row. One other thing to consider is your matching on your hyperlink. Make sure whatever matching you apply to it works on every row that contains it. If you are using a URL match rule, perhaps there's some part of the URL specific to each row.
Yeah I think my problem is the match rules. I am using a URL match rule and there is a part of the URL specific to each row. Does this mean I should not be using the URL match rule? I am very new to Pega RPA so I don't have a full grasp on the match rules yet.
I can't say without looking at your application how to match a given control. If you are new, here is what I would suggest to make it easier to identify which is the correct set of match rules.
1. Update the match rule of your page to invalidate it (add a 1 or some Xs to the start of one of the rules so it is now broken).
2. Interrogate your hyperlink on its own without the table.
3. Keep an eye on the Targets window. You'll want to adjust the match rule(s) so that all of the hyperlinks on every row appear in the Targets window with a green check box (so that you know whatever match rule(s) you've applied work on all of them).
4. For most match rules, you can adjust the text matching to use strategies other than "Simple". If your URL is the same except that it contains a digit in a specific place, you might use RegEx and swap out the Digit for "\d+" to account for any number that might appear there.
So I removed the URL match rule, and all hyperlinks are matched when viewing within the Targets section. However, as I run a PerformClick in my automation it still clicks the very first hyperlink in the column. I tried a few things with Keys, none of which worked but I don't think I entirely understand how the keys work. Do any of the screenshots I have attached help diagnose what I may be doing wrong? The one think I notice is the actually lnkPrint_Preview only applies to one of the targets. Unfortunately the website I am using contains a lot of sensitive information, so I am trying to provide as much as possible.