Question
Accenture
US
Last activity: 14 Sep 2020 12:13 EDT
Pega RPA Cannot capture hyperlink properly from a table in a web adapter
Hi Everyone,
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.
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Pegasystems Inc.
US
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.
Accenture
US
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.
Accenture
US
Also, the smaller Interrogation Form window displays an error that reads, "Unable to uniquely identify the control lnkPrint_Preview"
Pegasystems Inc.
US
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).
-
Jason Browoleit
Accenture
US
How do I go about manually moving the control?
Pegasystems Inc.
US
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.
-
Jason Browoleit
Accenture
US
Thank you so much for the help! I was able to update the OS file and the link is now under the table in the hierarchy.
My next question is, how do I pass the table index to run a perform click on the link? It still just clicks the link in the first row.
Pegasystems Inc.
US
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.
Accenture
US
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.
Pegasystems Inc.
US
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.
-
Jason Browoleit
Accenture
US
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.