Hi all,
I am using Selenium version 2.15 and have set up a Grid, but it is very unstable and I can't really figure out why. Since I am not very experienced with Selenium and Selenium Grid, could you please help me?
I have a hub with the following configuration:Grid Hub 2.15.0
Config details :
hub launched with :-role hub -log /var/log/selenium_hub_log
the final configuration comes from :
the default :
host : null
port : 4444
cleanupCycle : 5000
timeout : 300000
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :
all params :
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
maxSession : 5
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000
updated with grid1 config :No grid1 file specified. To specify one, use -grid1Yml XXX.yml where XXX.yml is a grid1 config file
updated with grid2 config : No hub config file specified. To specify one, use -hubConfig XXX.json where XXX.json is a hub config file
updated with params :
host : null
port : 4444
cleanupCycle : 5000
timeout : 300000
newSessionWaitTimeout : -1
grid1Mapping : {}
throwOnCapabilityNotPresent : true
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
prioritizer : null
servlets :
all params :
log : /var/log/selenium_hub_log
role : hub
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
cleanUpCycle : 5000
host : null
maxSession : 5
newSessionWaitTimeout : -1
nodePolling : 5000
port : 4444
prioritizer : null
servlets : []
throwOnCapabilityNotPresent : true
timeout : 300000
I don't know whether it is related to the Grid configuration or not, but sometimes my selenium tests just pause for a very very long time (I am not sure whether they are pausing or waiting or hanging), but I can't determine the root cause of that.
For one particular test I get the following exception:
<html>
<head>
<title>Error 500 java.util.concurrent.RejectedExecutionException</title>
</head>
<body>
<h2>HTTP ERROR: 500</h2><pre>java.util.concurrent.RejectedExecutionException</pre>
<p>RequestURI=/wd/hub/session/1345824337169/element/51/click</p>
<p><i><small><a href="http://jetty.mortbay.org">Powered by Jetty://</a></small></i></p>
</body>
</html>
Command duration or timeout: 1969.44 seconds ( = 33min!!!)
Sometimes, for other tests I get the following error:
203 2012-08-08 06:20:37 WebDriverException caught. Caused by GridException
204 2012-08-08 06:20:37 |--'WebDriverException' Message: Error forwarding the new session Error forwarding the request Read timed out
205 Command duration or timeout: 10800.39 seconds
206 Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
207 System info: os.name: 'Linux', os.arch: 'ppc64', os.version: '2.6.18-308.4.1.el5', java.version: '1.6.0'
208 Driver info: driver.version: RemoteWebDriver
209 2012-08-08 06:20:37 |--'GridException' Message: Error forwarding the new session Error forwarding the request Read timed out
210 2012-08-08 06:20:37 |--System Information: os.name: 'Linux', os.arch: 'ppc64', os.version: '2.6.18-308.4.1.el5', java.version: '1.6.0'
211 2012-08-08 06:20:37 |--Support URL: null
212 2012-08-08 06:20:37 |--Driver Information: driver.version: RemoteWebDriver
213 2012-08-08 06:20:37 \--Driver Name: RemoteWebDriver
214 2012-08-08 06:20:37 Caught exception: Error forwarding the new session Error forwarding the request Read timed out
215 Command duration or timeout: 10800.39 seconds ( = 3 hours -> this looks like a maximum timeout value)
216 Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
217 System info: os.name: 'Linux', os.arch: 'ppc64', os.version: '2.6.18-308.4.1.el5', java.version: '1.6.0'
218 Driver info: driver.version: RemoteWebDriver
So far I have always tried to restart the grid components, and in most cases that worked, but took some time - sometimes :-D.
Since I haven't found any forum post with the same exceptions I turned the debug option and the log on, on both the grid and the nodes. But for me it is really sophisticated to read.
My question is: What is the right approach to debug such timeout problems, which entries in the selenium grid hub / node indicate a problem and where is the right place to look - you may have noticed my extensive use of "sometimes", but right now I am not understanding what is happening...
I really appreciate every help!
I noticed, that I get a 3 hour time out
when my WebDriver loses the connection to the session / hub and
the code tries to use it again:
4 2012-09-21 12:45:09
Timed out waiting for page load.
345 Command duration or timeout:
1800.04 seconds
346 Build info: version: '2.25.0', revision:
'17482', time: '2012-07-18 21:08:56'
347 System info: os.name:
'Windows Server 2008', os.arch: 'x86', os.version: '6.0 build 6001
Service Pack 1', java.version: '1.6.0'
348 Driver info:
driver.version: RemoteWebDriver
349 Session ID:
2d23ad91-fcfb-4c03-a31f-a07b3fb87ab3
350 Command duration or
timeout: 1800.32 seconds
351 Build info: version: '2.15.0',
revision: '15105', time: '2011-12-08 09:56:25'
352 System info:
os.name: 'AIX', os.arch: 'ppc64', os.version: '7.1', java.version:
'1.6.0'
353 Driver info: driver.version: RemoteWebDriver
354
2012-09-21 12:45:09 Screenshot requested at URL
'http://hostname:7203/webui/'
355 2012-09-21 15:45:09
Unable to take screenshot.
org.openqa.selenium.remote.UnreachableBrowserException: Error
communicating with the remote browser. It may have died.
356 Build
info: version: '2.15.0', revision: '15105', time: '2011-12-08
09:56:25'
In my tests it was a default behavior to take a
screenshot after an exception has been thrown. But to take the
screenshot the code used the same driver object that threw the
timeout exception:
final WebDriver augmentedDriver = new
Augmenter().augment(getDriver());
if (augmentedDriver instanceof TakesScreenshot) {
I think,
after the time out exception the hub closed the session to the driver
that's why I get "Error communicating with the remote browser.
It may have died".
I changed my code to check the type of the
exception before attempting to take a screenshot - this solved the
problem.
But I still have a question:
Even after upgrading
to Selenium.2.25 I sometimes notice three hours timeouts. I think
they are all related to the hub trying to communicate with the nodes
/ browser:
2012-09-26 06:11:09 The test setup
passed.
186 2012-09-26 09:00:34 WebDriverException
caught. Caused by SocketException
187 2012-09-26 09:00:34
|--'WebDriverException' Message: Socket operation on nonsocket:
JVM_Bind
188 Command duration or timeout: 10165.39 seconds
189
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08
09:56:25'
190 System info: os.name: 'Linux', os.arch: 'amd64',
os.version: '2.6.16.60-0.83.2-default', java.version: '1.6.0'
191
Driver info: driver.version: RemoteWebDriver
192 2012-09-26
09:00:34 |--'SocketException' Message: Socket
operation on nonsocket: JVM_Bind
193 2012-09-26 09:00:34
|--System Information: os.name: 'Linux', os.arch: 'amd64',
os.version: '2.6.16.60-0.83.2-default', java.version: '1.6.0'
194
2012-09-26 09:00:34 |--Support URL: null
195
2012-09-26 09:00:34 |--Driver Information:
driver.version: RemoteWebDriver
196 2012-09-26 09:00:34
\--Driver Name: RemoteWebDriver
After the output "The
test setup passed." I attempt to create a
RemoteWebDriver:
driver = new RemoteWebDriver(hub,
getCapability());
actualCapability = driver.getCapabilities();
I believe the 3
hour timeout is somehow a default selenium value for the
communication between grid and nodes (or for session handling).
Is
there anyway to change this timeout value with the selenium API?
--To view this discussion on the web visit https://groups.google.com/d/msg/selenium-users/-/bCZ-cNG4JcYJ.
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
Hello Mike ,I am very new to Grid2 , I started the Grid2 from one cmd like belowC:\>java -jar selenium-server-standalone-2.25.0.jar -role hub http://localhost -port 4444and i registered my nodes to the HUB from another cmd like belowC:\>java -jar selenium-server-standalone-2.25.0.jar -Dwebdriver.chrome.driver=C:\chromedriver\chromedriver.exe -role webdriver -hub http://localhost:4444/grid/register -port 5558 -browser "platform=WINDOWS,browserName=chrome,maxInstances=5" -browser "browserName=firefox,maxInstances=10" -Dwebdriver.ie.driver=C:\IEDriverServer\IEDriverServer.exe -role webdriver -hub http://localhost:4444/grid/register -port 5559 -browser "browserName=internet explorer,maxInstances=1"I am trying to run my single test class in parallel , i am able to open the browsers with out any problem when i am trying to quit the browser i am getting the below exception
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:08:56'
Below is my Testclassimport base.TestBase;import test.Consts;public class TestApp2 extends TestBase {@Testpublic void Test1() throws InterruptedException, MalformedURLException{loadWebSite(Consts.TEST_SITE_NAME);}}My TestBase class is like belowpublic class TestBase {public static WebDriver driver =null;@BeforeClass(alwaysRun =true)@Parameters ({"browsername"})public void setup(String browser) throws MalformedURLException{DesiredCapabilities cap = new DesiredCapabilities() ;if (browser.equalsIgnoreCase("firefox")){cap.setBrowserName(DesiredCapabilities.firefox().getBrowserName());}if (browser.equalsIgnoreCase("iexplorer")){cap.setBrowserName(DesiredCapabilities.internetExplorer().getBrowserName());}if (browser.equalsIgnoreCase("chrome")){cap.setBrowserName(DesiredCapabilities.chrome().getBrowserName());}driver = new RemoteWebDriver( new URL("http://localhost:4444/wd/hub"),cap);}public static void loadWebSite(String siteName) {driver.get(siteName);}@AfterTestpublic void quit(){driver.quit();}}please help regarding thisadvanced thanksRao