WebDriverException: Message: Missing 'marionetteProtocol' field in handshake - selenium-webdriver

I'm currently trying to run a robotframework test scripts locally (Ubuntu 12.04 LTS 64 bit). The issue that I faced was not able to launch FF browser in Open Browser. Below is the details/specs of the setup that I have.
Firefox (v26.0)
Selenium2Library
selenium-server-standalone-2.53.1.jar
geckodriver-v0.9.0
Please note that I used same machine as hub and node (selenium grid)
Here the command to launch my hub :
java -jar selenium-server-standalone-2.53.1.jar -role hub -port 4444
While here's the command to register my node :
java -jar selenium-server-standalone-2.53.1.jar -role node -hub http://localhost:4444/grid/register -trustAllSSLCertificates
I did what is per told in https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette/WebDriver (add wires executable in the PATH)
I also did :
${ff default caps} Evaluate sys.modules['selenium.webdriver'].common.desired_capabilities.DesiredCapabilities.FIREFOX sys,selenium.webdriver
Set To Dictionary ${ff default caps} marionette=${True}
Create Webdriver Firefox executable_path=\home\my\wires
Open Browser ${HOMEPAGE} ff None ${HUB}
As a result, the FF browser launch, but not opening the URL ${HOMEPAGE}. I've been googling around and stuck in this issue for so long. Please help..

https://github.com/mozilla/geckodriver/releases
firefox version is too low , update to 48 is OK
python 2.7
selenium 3.0.1
geckodriver v0.11.0.exe
firefox 48.0

Related

Selenium Server ChromeDriver only supports Chrome version 80

I have Selenium Server 3.141.59 installed. I run it as a node via command
java -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.137.1:4444/grid/register/
Test code in Java creates WebDriver this way
System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); // Path to version 88
this.driver = new RemoteWebDriver("http://127.0.0.1:4444/wd/hub");
Test ends up with error: SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 80
How can I force Selenium Server to use project local driver?
Current version of Chrome is 88.

PhantomJS register with Selenium Grid

I need assistance on registering PhantomJS with Selenium Grid. Based on some approaches I've seen online I implemented it this way:
Grid register
java -jar selenium-server-standalone-3.0.0-beta2.jar -role hub -port 4444
PhantomJS
phantomjs.exe --webdriver=5555--webdriver-selenium-grid-hub=http://127.0.0.1:4444
both cmd started fine but phantomjs is not registered to the grid
As far as I know, you don't need Selenium to run the test against phantomjs in webdriver mode.
I don't know wich language and framework are you using. But In behat/mink/phantomjs:
Console:
phantomjs --webdriver=8643
And in your behat.yml:
sessions:
"Name_of _your_session":
selenium2:
wd_host: "http://localhost:8643/wd/hub"
The important part here is: wd_host: "http://localhost:8643/wd/hub"
That I'm sure that you can adapt to whatever your system is. You can run the phantomjs from another server and use it only by modifying the IP: "http://XXX.XXX.XXX.XXX:8643/wd/hub"
But you don't need to run the selenium server.

FirefoxWebdriver on remote machines

Is it required to install the Firefox web driver on the remote machines acting as node or hub?
I tested the hub and nodes locally? I think, it is necessary to install the web driver on the hub and node. Any comments or suggestions?
Update:
Selenium jars are running (i.e. Java is installed and web driver also exists within the selenium jar as per the documentation). Why am I getting this error
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Unable to connect to
host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Also,
(process:13023): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified
Thanks in advance!
You don't need anything on the machine that runs the hub except the selenium jar.
On the machine that runs the node you only need firefox itself to be installed, and the selenium jar running.
Firefox doesn't need a webdriver, only chrome.
from documentation
Firefox driver is included in the selenium-server-stanalone.jar
Yesterday, I was able to find the root cause, I was running these on the headless machines and needed those to be configured in order to launch ff. Thanks for your help!

Understanding SeleniumGrid

I have been trying to implement selenium grid being new to selenium2 .What i can't understand is do we actually need to have our node which we register with the hub have the configurations which we specify in our test.
By this I mean : say my machine which has windows on it,can I register it as node with the hub having configurations platform:LINUX,browserName:firefox or can I only register my machine as windows type?
I tried with Linux-firefox and my test passed also.But am not clear how can it run on a linux platform,if my machine was Windows
java -jar selenium-server-standalone-2.25.0.jar -role webdriver
-browser "browserName=firefox,platform=LINUX" -hub http://127.0.0.1:4444/grid/register
I currently have a Hub that is in Linux and several windows nodes and don't have an issue. When I register the HUB machine, I use the following code from the command prompt:
java -jar selenium-server-standalone-2.39.0.jar -role hub
Then, from each node machine, I run the a variant of the following code...depending on what configuration I want:
java -Dwebdriver.chrome.driver=c:\selenium\chromedriver.exe - Dwebdriver.iexplorer.driver=c:\selenium\IEDriverServer.exe -jar selenium-server-standalone-2.39.0.jar -role webdriver -hub http://<YOURHUBSERVER>:4444/grid/register -port 6660 -browser browserName=firefox,maxInstances=0 -browser browserName=chrome,maxInstances=3 -browser browserName=iexplorer,maxInstances=0 -maxSessions=3
Just make sure the node computer has the jar file and all your paths are correct.
Once you do this, you will be able to see them in your Grid configuration.
Hope this helps.

Selenium grid2 plugin --display switch

I am trying to run a firefox node on ubuntu 12.04. I have 5 x sessions running. If I run the command firefox --display=:1 everything works and I can vnc on to the desktop and see firefox running. Next I have created a plugin for selenium grid2 where I set the capability moz.switches to --display=:1. When I run a test I can see on the node logs that the capability is present however it appears the switch is not getting sent to the firefox command:
11:46:38.603 INFO - Creating a new session for Capabilities [{platform=ANY, webdriver_assume_untrusted_issuer=false, noVNCPort=5901, browserName=firefox, moz.switches=[--display=:1], webdriver_accept_untrusted_certs=true, version=, x=1}]
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
Error: no display specified
I got the moz.switches code from https://github.com/freynaud/grid-spine-selenium/blob/master/src/main/java/com/ebay/spine/LinuxWebDriverVNCProxy.java#L325 but it doesn't seem to be working. Does anyone have any experience writing this type of plugin? I'm a bit stuck really and looking at the selenium code can't see this moz.switches flag nor how I could debug the problem...

Resources