How to debug Selenium Tests created by Parasoft Selenic

Matt LoveMatt Love Posts: 48 admin
edited October 2019 in Selenic

Parasoft Selenic makes it easy to record web UI workflows in Chrome and create/run Selenium test scripts in Eclipse, but what if you need to debug those test scripts? The Debug menu in Eclipse will fail the test right away with an IllegalStateException because the path to the Chrome WebDriver was not set.

You will not have seen this error using the Run with Selenic menu because Parasoft Selenic will prompt out-of-the-box for the WebDriver location and save it in a global preference for all future runs. You will need to copy the VM argument for the WebDriver from the Selenic configuration to the Debug configuration.

Open the Selenic Configurations dialog.

Click the button to Show Command Line.

Copy the argument that starts with "-Dwebdriver.chrome.driver="

Close the Selenic Configurations dialog and open Debug Configurations.

Switch to the Arguments tab and paste the WebDriver property in the VM arguments box. Make sure to add a space after any existing arguments.

Click the Debug button and the test will launch in the Eclipse debugger and stop at any breakpoints that you set.

This will give you a chance to inspect elements in the browser before continuing the test execution.

Tagged:
Sign In or Register to comment.