selenium + chrome headless=new : waiting for jquery / ajax completion

67 views
Skip to first unread message

carl verret

unread,
Apr 17, 2023, 10:23:01 AM4/17/23
to Selenium Users
Using .net 7 and selnium, I just came across this new chrome option (--headless=new) for the new headless mode.

As I'm trying this new option, my actual test code used for waiting till ajax/jquery is completed don't work anymore :

    while (true)
        {
   
          var ajaxIsComplete = (bool)(driver.Instance as IJavaScriptExecutor).ExecuteScript("return window.jQuery != undefined && jQuery.active === 0");
          if (ajaxIsComplete)
            break;
          Thread.Sleep(1500);
   
        }

Switching back to my usual "--headless" works perfectly fine.  As anyone experimented this problem ?

Thanks

Reply all
Reply to author
Forward
0 new messages