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.