Search code examples
seleniumnewrelic

NewRelic scripted browser interact with popup for login


Is it anyhow possible in new relic scripted browser to interact with a popup?

Is the following possible and if yes, how can I achieve the following?

  1. Open url "https://sample.com"
  2. Click button with id login
  3. A popup opens
  4. In popup fill username and password and click submit
  5. Popup closes
  6. Continue within application.

Basically the popup is the piece I'm struggling with. I searched documentation but was not able to find anything on how to interact with the popup.

Thx I really appreciate your expertise


Solution

  • This depends on what popup is defined as - a new browser window or an element embedded in a div or iframe? Either way, here are some solutions to either one:

    Switching to a new browser window: https://github.com/newrelic/quickstarts-synthetics-library/blob/main/library/TabOrWindowSwitching/script.js

    New Relic forum post containing several solutions/examples: https://discuss.newrelic.com/t/how-to-handle-intermittent-pop-up/38200