Skip to main content
Solved

Browser Automation Seems Unable to Capture Elements in Modal

  • September 20, 2024
  • 2 replies
  • 134 views

Forum|alt.badge.img+17

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.

View original
Did this topic help answer your question?

2 replies

Forum|alt.badge.img+8
  • Navigator | Tier 3
  • 59 replies
  • Answer
  • September 20, 2024

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


Forum|alt.badge.img+17
  • Author
  • Flight Specialist | Tier 4
  • 87 replies
  • 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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings