WebDriver script failing
search cancel

WebDriver script failing

book

Article ID: 198043

calendar_today

Updated On: 04-12-2024

Products

CA App Synthetic Monitor DX Application Performance Management

Issue/Introduction

I have a WebDriver script that is failing, but I am not seeing any log information. Please let me know why the script is failing?
Seeing that the Sign-in failed with a "System is Unavailable" message.

Environment

Release : SAAS

Component : CA APP SYNTHETIC MONITOR (WATCHMOUSE)

Cause

Step causing the issue:

Step 4 - waitForPageToLoad.

EXPECTED BEHAVIOR:

The monitor is waiting for a page to be loaded.

ACTUAL BEHAVIOR:

Login on the previous step does not cause reload of the page, it uses ajax instead.

Since that - the Webdriver decides the page is loaded already, which is true.

Webdriver decides the last step as executed and interrupts the connection.

In the report, we see browser errors that XHR request to the backend was interrupted.

15:20:44
 
https://example.com - Failed to load resource: net::ERR_PROXY_CONNECTION_FAILED
 SEVERE

15:20:44
 
https://example.com "Network Error"

At the same time on the browser side, the website JS script catches the network error and shows a message "System is unavailable...".

Resolution

Do not use command waitForPageToLoad after login, since there is no page reload.

Use command waitForText, waitForElementPresent or something similar instead.

 

 

Additional Information

Why is it working in Selenium IDE or Katalon Recorder and not working in ASM?

 

On the client machine, the internet connection is consistent. After the script executed already, a browser continues to load the page until done.

The ASM environment is working differently, like a sandbox. It creates and then interrupts network connection for each session separately.

The connection is being interrupted when the last step is executed.