Skip to main content
Most Valuable Pathfinder
September 20, 2024
Solved

Browser Automation Seems Unable to Capture Elements in Modal

  • September 20, 2024
  • 2 replies
  • 375 views

I am just curious if anyone has encountered this before. I am currently converting a bot from using standard Recorder actions to using the Browser Automation package. Everything works as expected with the exception of capturing data from a pop-up modal window.

The screenshot shows the Recorder way of capturing the table in the dialog box. The bot then runs through each row in the table and, if it meets certain criteria, downloads the associated PDF. This method works well.

With the Browser Automation package, however I cannot seem to capture any of the elements. I have attempted by the full XPath, the ID, and the CS Selector, but no joy. I can capture nothing in the dialog box, whether the full table (what I am after) or just the “3 documents sent.” text at the top; they all return null. As a test, in the console of the page I can do something like document.getElementById(<text ID>).textContent; and I get what I would expect. However doing the same in Browser Automation:Execute JavaScript action returns the error “Cannot read properties of null...”.

Using latest package version, latest Chrome driver, etc. Just curious if anyone has encountered the same resistance when working with embedded frames, and if you’ve found ways around it

 

 

Best answer by Bot Dev

Switch to target frame first, then execute.
Reset to default to target default dom.

2 replies

Bot DevAnswer
Navigator | Tier 3
September 20, 2024

Switch to target frame first, then execute.
Reset to default to target default dom.

https://github.com/A360-Tools | https://botstore.automationanywhere.com/vendor/botdev
Most Valuable Pathfinder
September 20, 2024

Thanks for the reply. I had tried the Select Frame action previously, but think I was still trying by XPath at that point. I found that if I select the frame and then grab the table by the ID rather than XPath, it works. Thanks for the nudge.