Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to confirm a Chrome alert (pop-up window)?

munich
munich Posts: 2

Hi, I am using Parasoft SOATest to test a WebApp automatically. In one case a Chrome alert appears and behaves like a modal pop-up window, I would like Parasoft to confirm it automatically, that means clicking on the OK button or pressing the Enter key.

How can I achieve it?

I did not find any build-in function to confirm the alert, furthermore I have tried it using JavaScript action and a groovy script in the extension tool, nothing of the mentioned above worked. Maybe you have an idea? I am using Parasoft SOAtest & Virtualize Version 2021.2

Many thanks in advance!

Answers

  • munich
    munich Posts: 2

    Thanks for the quick response, tried this action, too, but it did not confirm the pop-up. Maybe it is because the pop-up does not belong to the WebApp that is being tested, but comes from Chrome itself: It is an alert about passwords and it cannot be located or inspected with the usual browser dev tools.

  • benken_parasoft
    benken_parasoft Posts: 1,380 ✭✭✭
    edited September 24

    For interacting with user interface elements that are not part of the web page we have suggested adding a External tool to run an external script. We typically suggest creating the script with AutoIt.

    An alternative would be to disable the password manager completely. By default, a temporary Chrome browser profile is created on playback each time. However, there is a way for SOAtest to tell Chrome to always use a specific browser profile, like one that has "Offer to save passwords" disabled in the Chrome password manager settings. You can tell Chrome what profile directory to use by passing a "--user-data-dir" argument. You can then tell SOAtest to pass the same "--user-data-dir" argument each time it starts Chrome. Some detail can be found here: Using Chrome Extensions and Configurations During Recording and Playback