Selenium C # ngwebelement is timing out

292 Views Asked by At

I am facing script execution issue. This has started all of sudden. I am using protractor wrapper class over selenium. Ie,

driver = new Chromedriver("driver path", option);
ngdriver=new ngWebDriver(driver);
ngdriver.Navigate().GotoURL("url");
ngdriver.IgnoreSynchronization=false;
ngdriver.findelement(By.xpath("xpath ")).Click 

--> this step is failing

When I run a command(ngdriver.findelement(By.xpath("xpath ")).Click ) for clicking on ngWebElement using protractor wrapper class in Selenium C# I am getting Script Timeout (session info: chrome 90.0.4430.212)

This works fine when I do "ngdriver.ignoreSynchronization=true". But I don't want this solution because there is lot of change I need to make in terms of synchronization. So far protractor wrapper class used to take care of it.

Please help if anyone aware about this issue.

Url and elements are confidential and hence I am not posting the actual Url

1

There are 1 best solutions below

3
On

i don't know what C# wrapper is but ignoreSynchronization is deprecated from protractor. waitForAngularEnabled should be used instead. Maybe its different in C# library...

what both commands do, they instruct protractor to wait until angular finished polling tasks on the background. There are really 2 ways to avoid these tasks - one is to run await browser.waitForAngularEnabled(false) and then manually handle all waiting, or to fix the application and fix the code that causes these tasks to run for too long. There is no really other way