Skip to content

Instantly share code, notes, and snippets.

@esumerfd
Last active March 4, 2020 19:54
Show Gist options
  • Save esumerfd/1b719fde83949c2c62a44a36b30b88fc to your computer and use it in GitHub Desktop.
Save esumerfd/1b719fde83949c2c62a44a36b30b88fc to your computer and use it in GitHub Desktop.
Selenium Grid or geckodriver problem?

The geckodriver, when running as a Selenium Grid node fails to find any tags. When run with Selenium Standalone or the driver on its own it works fine.

✖ Timed out while waiting for element <body> to be present for 30000 milliseconds. - expected "visible" but got: "not found" (30014ms)
    at Object.<anonymous> (.../nightwatch/BaseCommand.js:69:24)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Selenium Standalone - geckodriver

12:38:22.795 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session d6558ead-271f-a14d-a967-85052887b516 (org.openqa.selenium.firefox.GeckoDriverService)
1583257102833	webdriver::server	DEBUG	-> POST /session/d6558ead-271f-a14d-a967-85052887b516/url { "url": "http:\u002f\u002flocalhost:5000\u002fversion" }
1583257102834	Marionette	DEBUG	0 -> [0,2,"WebDriver:Navigate",{"url":"http://localhost:5000/version"}]
1583257102840	Marionette	TRACE	[17] Received DOM event beforeunload for about:blank
1583257102855	Marionette	TRACE	[17] Received DOM event pagehide for about:blank
1583257102863	Marionette	TRACE	[17] Received DOM event DOMContentLoaded for http://localhost:5000/version
1583257102910	Marionette	TRACE	[17] Received DOM event pageshow for http://localhost:5000/version
1583257102929	Marionette	DEBUG	0 <- [1,2,null,{"value":null}]
1583257102934	webdriver::server	DEBUG	<- 200 OK {"value":null}
1583257102953	webdriver::server	DEBUG	-> POST /session/d6558ead-271f-a14d-a967-85052887b516/elements { "value": "body", "using": "css selector" }
1583257102954	Marionette	DEBUG	0 -> [0,3,"WebDriver:FindElements",{"using":"css selector","value":"body"}]
1583257102958	Marionette	DEBUG	0 <- [1,3,null,[{"element-6066-11e4-a52e-4f735466cecf":"72499757-f7f6-974e-8286-a7e9377ec318"}]]
1583257102959	webdriver::server	DEBUG	<- 200 OK {"value":[{"element-6066-11e4-a52e-4f735466cecf":"72499757-f7f6-974e-8286-a7e9377ec318"}]}
1583257102997	webdriver::server	DEBUG	-> POST /session/d6558ead-271f-a14d-a967-85052887b516/execute/sync {

Successfully finds the "body" tag and continues with the test.

Selenium Grid Node - same geckodriver

12:33:48.426 INFO [RemoteSession$Factory.lambda$performHandshake$0] - Started new session cd002f65-7868-fd40-a972-60e262c0c472 (org.openqa.selenium.firefox.GeckoDriverService)
1583256828453	webdriver::server	DEBUG	-> POST /session/cd002f65-7868-fd40-a972-60e262c0c472/url {"url":"http://localhost:5000/version"}
1583256828456	Marionette	DEBUG	0 -> [0,2,"WebDriver:Navigate",{"url":"http://localhost:5000/version"}]
1583256828461	Marionette	TRACE	[17] Received DOM event beforeunload for about:blank
1583256828472	Marionette	TRACE	[17] Received DOM event pagehide for about:blank
1583256828479	Marionette	TRACE	[17] Received DOM event DOMContentLoaded for http://localhost:5000/version
1583256828522	Marionette	TRACE	[17] Received DOM event pageshow for http://localhost:5000/version
1583256828526	Marionette	DEBUG	0 <- [1,2,null,{"value":null}]
1583256828535	webdriver::server	DEBUG	<- 200 OK {"value":null}
1583256828555	webdriver::server	DEBUG	-> POST /session/cd002f65-7868-fd40-a972-60e262c0c472/elements {"using":"css selector","value":"body"}
1583256828562	Marionette	DEBUG	0 -> [0,3,"WebDriver:FindElements",{"using":"css selector","value":"body"}]
1583256828568	Marionette	DEBUG	0 <- [1,3,null,[{"element-6066-11e4-a52e-4f735466cecf":"e5c94ca4-e65e-f74a-afa8-b062ce7f2f53"}]]
1583256828569	webdriver::server	DEBUG	<- 200 OK {"value":[{"element-6066-11e4-a52e-4f735466cecf":"e5c94ca4-e65e-f74a-afa8-b062ce7f2f53"}]}
1583256829080	webdriver::server	DEBUG	-> POST /session/cd002f65-7868-fd40-a972-60e262c0c472/elements {"using":"css selector","value":"body"}
1583256829081	Marionette	DEBUG	0 -> [0,4,"WebDriver:FindElements",{"using":"css selector","value":"body"}]
1583256829083	Marionette	DEBUG	0 <- [1,4,null,[{"element-6066-11e4-a52e-4f735466cecf":"e5c94ca4-e65e-f74a-afa8-b062ce7f2f53"}]]
1583256829084	webdriver::server	DEBUG	<- 200 OK {"value":[{"element-6066-11e4-a52e-4f735466cecf":"e5c94ca4-e65e-f74a-afa8-b062ce7f2f53"}]}

Times out finding body tag.

Versions:

  • Using: firefox (73.0.1) on mac 19.3.0 platform.
  • geckodriver 0.26.0 (e9783a644016 2019-10-10 13:38 +0000)
  • node_modules/selenium-server/lib/runner/selenium-server-standalone-3.141.59.jar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment