Chrome running in Selenium grid will sometimes wait the amount of time specified in PageLoad for no apparent reason, does not happen in local

258 views
Skip to first unread message

elgatonegrov

unread,
Oct 22, 2019, 4:14:09 PM10/22/19
to Selenium Users
Hi everyone,

I am having issues debugging a random error that will sometimes appear in Selenium grid but is not reproducible in local.

The build is run through Azure which queries another server where Selenium grid is running.

The error says as follows:

49.52s Searching element: By.ClassName[Contains]: glyphButton
49.69s Element found: By.ClassName[Contains]: glyphButton
50.39s Clicking element
200.62s EXCEPTION: timeout
 
(Session info: chrome=77.0.3865.120)

Test method TestMethod1 threw exception:
OpenQA.Selenium.WebDriverTimeoutException: timeout
(Session info: chrome=77.0.3865.120)


The timeout (150 seconds) corresponds only with the one set in PageLoad:

driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(150);


 
As I said before, the build is run through Azure which connects to a CentOS (CentOS Linux release 7.7.1908) machine running Selenium server (version: 3.141.59, revision: e82be7d358).
Both Selenium hub and nodes are running via systemd services, defined as follow:

selenium-hub:
---
 
[Unit]
Description=Selenium Hub
[Service]
ExecStart=/bin/java -jar /opt/selenium-server-standalone.jar -role hub -hubConfig hubconfig.json
[Install]
WantedBy=multi-user.target


Nodes are run with xfvb because headless was not available when the setup was done:

selenium-nodes:
---

[Unit]
Description=Selenium nodes
[Service]
ExecStart=/bin/xvfb-run -a '--server-args=-screen 0 1920x1080x24' -e xvfb-run.log java -jar selenium-server-standalone.jar -role node -nodeConfig google-nodeconfig.json
DeviceAllow=/dev/shm rwm
[Install]
WantedBy=multi-user.target

google-nodeconfig.json:
---

{
   
"capabilities":
       
[
           
{
               
"browserName": "chrome",
               
"maxInstances": 8,
               
"seleniumProtocol": "WebDriver",
               
"webdriver.chrome.driver": "/usr/local/bin/chromedriver"
           
}
       
],
   
"_comment": "Configuration for Node",
   
"timeout": 180,
   
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
   
"port": 5555,
   
"debug": true,
   
"register": true,
   
"maxSession": 8
}

As you can see, 8 instances can be run at the same time, so I am not able to retrieve the correct logs at the time. (Any help is appreciated on this front)
 
Other timeouts are either shorter or longer, for example the RemoteWebDriver instance is created with a Timeout of 180 seconds:

public static RemoteWebDriver RemoteDriver(string UriServerHubSelenium)
{
   
var chromeRemoteOptions = new ChromeOptions();
        chromeRemoteOptions
.AddArgument("enable-automation");
        chromeRemoteOptions
.AddArgument("disable-infobars");
        chromeRemoteOptions
.AddArgument("disable-notifications");
        chromeRemoteOptions
.AddArgument("no-sandbox");
        chromeRemoteOptions
.AddArgument("window-size=1920,1080");

   
var remoteDriver = new RemoteWebDriver(new Uri(UriServerHubSelenium), chromeRemoteOptions.ToCapabilities(), TimeSpan.FromSeconds(180));

   
return remoteDriver;
}

So my question is, how can I better debug what is happening behind the scenes to understand why this is happening? I have an inkling that the webpage is running scripts continuously or trying to reach another domain and that is why this is happening, but I have no way of backing this up and bossman wants answers.

Thank you for your time. Feel free to ask any questions.

Regards.

⇜Krishnan Mahadevan⇝

unread,
Oct 23, 2019, 12:37:42 AM10/23/19
to Selenium Users
Have you ruled out any concurrency issues in your tests which is causing tests to perhaps step on each others shoes ?

AFAIK, the client side timeouts are completely managed at the client level (which is your tests) and the Grid has no say on them.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5a2ed8f6-3702-4b20-b0b0-50339d505ee7%40googlegroups.com.

elgatonegrov

unread,
Oct 23, 2019, 3:44:59 PM10/23/19
to Selenium Users
Hi Krishnan,

yes, there are no concurrency issues as far as I am aware.


On Wednesday, October 23, 2019 at 6:37:42 AM UTC+2, Krishnan Mahadevan wrote:
Have you ruled out any concurrency issues in your tests which is causing tests to perhaps step on each others shoes ?

AFAIK, the client side timeouts are completely managed at the client level (which is your tests) and the Grid has no say on them.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

elgatonegrov

unread,
Oct 24, 2019, 11:30:11 AM10/24/19
to Selenium Users
Also, for some reason, logs are not being created even though I set it correctly in the json file:

{
    "capabilities":
        [
            {
                "browserName": "chrome",
                "maxInstances": 8,
                "seleniumProtocol": "WebDriver",
                "webdriver.chrome.driver": "/usr/local/bin/chromedriver",
                "webdriver.chrome.verboseLogging": "true",
                "webdriver.chrome.logfile": "/tmp/chromedriver.log"
            }
        ],
    "_comment": "Configuration for Google Chrome Node",
    "timeout": 180,
    "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
    "port": 5555,
    "debug": true,
    "register": true,
    "maxSession": 8
}


Selenium Grid configuration:

browser_configuration.png

Mike Hetzer

unread,
Oct 24, 2019, 1:26:39 PM10/24/19
to Selenium Users
This might sound kinda lazy but . . have you tried running same iteration but with less max instances?

8 instances of chromedriver is very process and RAM intensive which can affect speed of tests.
It would be good to rule this out.

elgatonegrov

unread,
Oct 24, 2019, 2:26:28 PM10/24/19
to Selenium Users
Hi Mike Hetzer,

Indeed, we tried running 4 instances and 2 instances at the same time and the error still happens. That's why I want to create chromedriver logs, however it seems I am unable to do so and I am not sure where I am failing.

Thank you.
Regards.
Reply all
Reply to author
Forward
0 new messages