Error while registering node in selenium grid - selenium-grid

I am getting below error while starting node for selenium grid-
Default driver org.openqa.selenium.ie.InternetExplorerDriver registration is skipped: [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}]
does not match with current platform: MAC
My local system that is hub contains MAC and FIREFOX
Below the configuration of my node(VM).My scripts are on my local machine that is hub-
{
"class": "org.openqa.grid.common.RegistrationRequest",
"capabilities": [
{
"seleniumProtocol": "WebDriver",
"browserName": "firefox",
"version": "25.0.1",
"maxInstances": 1,
"platform" : "LINUX"
}
],
}
Please suggest needful.

There might be two obvious errors:
In your code, you state Platform as Linux but you are running on MAC
The same might be on the node setup. If you run node on mac and then request for Internet Explorer on Windows, it will be simply skipped, hence there is no node running on Windows...

Related

why It show me This version of ChromeDriver only supports Chrome version 104?

when I use wdio for e2e tests, I got an exception.But my chromedriver is 106.0.1.
[0-1] 2022-10-24T10:58:18.928Z ERROR webdriver: Request failed with status 500 due to session not created: session not created: This version of ChromeDriver only supports Chrome version 104
[0-1] Current browser version is 106.0.5249.119 with binary path /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
but when I check chromedriver:
chromedriver -v
ChromeDriver 106.0.5249.61 (511755355844955cd3e264779baf0dd38212a4d0-refs/branch-heads/5249#{#569})
I has been tried all those methods:
SessionNotCreatedException: Message: session not created: This version of ChromeDriver only supports Chrome version 81.
But I still got same exception.please help me.
My configureation:
module.exports.config = {
runner: "local",
path: "/wd/hub",
specs: ["./test/specs/*.js"],
maxInstances: 1,
capabilities: [
{
pageLoadStrategy: "none",
maxInstances: 1,
//
browserName: "chrome",
"goog:chromeOptions": {
excludeSwitches: ["enable-automation"],
},
},
],
logLevel: "warn",
bail: 0,
baseUrl: "http://localhost:3333",
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
services: ["chromedriver"],
framework: "mocha",
reporters: ["spec"],
}
I resolve this question by configure path.
services: [
[
"chromedriver",
{
chromedriverCustomPath: "/usr/local/bin/chromedriver",
},
],
],
I solved this problem by configuring the path. But I don't think this is a good method, because it means that any participant who uses this testing function needs to set the chromedriver in this path.
In fact, another project with the same npm version and my other configuration can run normally without configuring the path. This is really strange! This shows that my local chromedriver has no problems and can run directly.

How to Run Parallel Appium Test With Selenium Grid Only By Specifying Platform

I am running parallel robot framework Appium tests using pabot. Below are my config files:
configDevice1.json
{
"capabilities":[
{
"platformName": "Android",
"platformVersion": "9.0",
"browserName": "Android-Huawei-Matepad",
"deviceName": "Huawei Matepad",
"udid": "902xxxxxxx",
"appActivity":"com.app.MainActivity",
"appPackage":"com.app.preview",
"noReset":false,
"automationName":"uiautomator2",
"groups":"device",
"maxInstances": 1
}
],
"configuration":
{
"url":"http://127.0.0.1:4724/wd/hub",
"cleanUpCycle":2500,
"timeout":30000,
"maxSession": 1,
"register": true,
"registerCycle": 1000,
"hubPort": 4444,
"hubHost": "localhost"
}
}
configDevice2.json
{
"capabilities":[
{
"platformName": "Android",
"platformVersion": "9.0",
"browserName": "Android-Samsung",
"deviceName": "Android Samsung",
"udid": "111xxxxxxx",
"appActivity":"com.app.MainActivity",
"appPackage":"com.app.preview",
"noReset":false,
"automationName":"uiautomator2",
"groups":"device",
"maxInstances": 1
}
],
"configuration":
{
"url":"http://127.0.0.1:4724/wd/hub",
"cleanUpCycle":2500,
"timeout":30000,
"maxSession": 1,
"register": true,
"registerCycle": 1000,
"hubPort": 4444,
"hubHost": "localhost"
}
}
I started the two Appium nodes in separate process:
appium --nodeconfig configDevice1.json -p 4723 -bp 5723
appium --nodeconfig configDevice2.json -p 4724 -bp 5724
The parallel test works fine if I define the udid on the desired capabilities. However, I am looking for a way to run parallel test without having to specify any udid. For instance, I want to run parallel tests on all devices with platform of Android.
When I run the parallel tests only with capabilities of platformName=Android, all tests run only on one device, conflicting each session from another.
I can see Appium is retrieving connected devices, but then only proceed selecting the first device from that list. This happens in both Appium sessions (Hence making tests failure because it tries to override an existing session)
[debug] [ADB] Connected devices: [{"udid":"111xxxxxxx","state":"device"},{"udid":"902xxxxxxx","state":"device"}]
[AndroidDriver] Using device: 111xxxxxxx
Is there anything one can do to make tests parallel on platform information available on Selenium grid nodes?
Thanks!
Silly me. The config.json value set should be platform and version. It works well now!

Cannot execute protractor tests using headless chrome on Selenium Grid nodes

I'm using Selenium server 3.8.1, with the hub and 2 nodes.
The hub and each node are executed on different machines.
Currently, I can launch the tests and they're working fine. But, I'm not able to make the headless mode run.
My config JSON only contains the capabilities object.
{
"capabilities":
[{
"browserName": "chrome",
"maxInstances": 3,
"seleniumProtocol": "WebDriver",
"chromeOptions": {
"args": [
"--headless",
"--disable-gpu",
"--window-size=1920x1080"]
}}]
}
I launch the selenium nodes using a .bat that contains the following command:
"C:\Program Files\Java\jre1.8.0_181\bin\java" -jar C:\jobs\selenium-node\selenium-server-standalone-3.8.1.jar -role node -hub http://172.16.0.5:5555/grid/register -port 5558 -nodeConfig config.json -maxSession 3
The selenium node works fine and appears on the selenium grid UI. Also, the capabilities of the chrome driver include the --headless and other parameters:
....
capabilities: Capabilities {browserName: chrome, chromeOptions: {args: [--headless, --disable-gpu, --window-size=1920x1080]}, maxInstances: 3, platform: XP, se:CONFIG_UUID: cdc21610-4c47-4d23-9478-a20..., seleniumProtocol: WebDriver}
....
On the protractor.conf file I have these capabilities, that work when I run the tests locally.
seleniumAddress:'http://172.16.0.5:5555/wd/hub',
getPageTimeout: 120000,
allScriptsTimeout: 120000,
ignoreUncaughtExceptions: true,
chromeOnly:true,
directConnect: false,
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
capabilities: {
"javascriptEnabled": true,
"acceptSslCerts": true,
"browserName": "chrome",
"chromeOptions": {
"args": [ "--headless", "--disable-gpu", "--window-size=1920,1080"]
}
},
But, when I launch the tests, the chrome driver isn't executed on headless mode. Works fine, but the different windows keep appearing.
Environment details:
chromedriver version: 2.36.540470
chrome version: 69.0.3497.100
As per your question/comment update you are using:
chromedriverVersion: '2.36.540470, chrome version' => '69.0.3497.100'
Your main issue is the incompatibility between the version of the binaries you are using as follows:
You are using chromedriver=2.36
Release Notes of chromedriver=2.36 clearly mentions the following :
Supports Chrome v63-65
You are using chrome=69.0
Release Notes of ChromeDriver v2.42 clearly mentions the following :
Supports Chrome v68-70
So there is a clear mismatch between the ChromeDriver v2.36 and the Chrome Browser v69.0
Solution
Upgrade Selenium to current levels Version 3.14.0.
Upgrade ChromeDriver to current ChromeDriver v2.42 level.
Keep Chrome version between Chrome v68-70 levels. (as per ChromeDriver v2.42 release notes)
Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.

How to start remote Safari Technology Preview from Selenese Runner Java

I have here a Selenium Hub and a Selenium Node with Config:
{
"capabilities":
[
{
"browserName": "safari",
"version": "10",
"maxInstances": 1,
"webdriver.safari.driver": "/Applications/Safari\ Technology\ Preview.app/Contents/MacOS/safaridriver"
}
],
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 1,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hub": "<IP>:4444",
"role": "node",
}
If I try to start a test from a Maven project with the code:
SafariOptions safariOptions = new SafariOptions();
safariOptions.setUseTechnologyPreview(true);
safariOptions.setUseCleanSession(true);
DesiredCapabilities capabilities = DesiredCapabilities.safari();
capabilities.setCapability(SafariOptions.CAPABILITY, safariOptions);
RemoteWebDriver driver = new RemoteWebDriver(
new URL("http://172.31.4.70:4444/wd/hub"), capabilities);
System.out.println(capabilities.toString());
System.out.println(safariOptions.toJson().toString());
driver.manage().window().maximize();
driver.get("https://check24.de/kredit");
//Close the browser
driver.quit();
On the MAC, the Safari Technology Preview starts no problem.
The Selenium Hub log:
14:02:03.874 INFO - Got a request to create a new session: Capabilities [{browserName=safari, safari.options={technologyPreview=true, port=0, cleanSession=true}, version=, platform=MAC}]
14:02:03.898 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, webdriver.safari.driver=/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver, browserName=safari, maxInstances=1, version=10, platform=MAC}
Now I'd like to start that with Selenese Runner Java with
java -jar C:\selenium\selenese-runner.jar --driver remote --remote-url http://<ip>:4444/wd/hub --remote-platform MAC --remote-browser "safari" --define "safari.options={technologyPreview=true, port=0, cleanSession=true}" --screenshot-on-fail C:\selenium\screenshot --max-time 600 --baseurl %1 %2
The log on the Seleniu Hub is the same:
14:05:26.088 INFO - Got a request to create a new session: Capabilities [{browserName=safari, safari.options={technologyPreview=true, port=0, cleanSession=true}, version=, platform=MAC}]
14:05:26.102 INFO - Trying to create a new session on test slot {seleniumProtocol=WebDriver, webdriver.safari.driver=/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver, browserName=safari, maxInstances=1, version=10, platform=MAC}
But a Safari (NOT Technology Preview) instante starts on the Selenium Node.
The different is that one send the safari.option with safariOption Class and one send it with plain text.
I cannot understand why there is defferent.
Have you any Idea?
Thanks!
Lian Shen

Launch Safari on Mac node from Windows PC with Selenium RemoteWebDriver and Grid

I'm trying to fire off a test to my iMac from my Windows PC.
I have downloaded and installed the webdriver addon for Safari and I have established a connection to my Windows based Selenium Grid hub.
When I try to run my test I receive an error for an OperaDriver:
org.openqa.selenium.WebDriverException: The best matching driver provider org.openqa.selenium.opera.OperaDriver can't create a new driver instance for Capabilities [{browserName=safari, safari.options={port=0, cleanSession=true}, version=9, platform=MAC}]
Current Setup:
Windows PC:
java -jar selenium-server-standalone-2.53.0.jar -role hub -port 4445
Mac:
java -jar selenium-server-standalone-2.53.0.jar -role node -nodeConfig node1Config.json
node1Config:
{
"capabilities": [
{
"browserName": "safari",
"acceptSslCerts": true,
"javascriptEnabled": true,
"takeScreenshot": false,
"browser-version": "9",
"platform": "MAC",
"maxInstances": 5,
"cleanSession": true
}
],
"configuration": {
"_comment": "Configuration for Node",
"cleanUpCycle": 2000,
"timeout": 30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"port": 5568,
"hubHost": "MyNetworkIpWasHere",
"register": true,
"hubPort": 4445,
"maxSessions": 5
}
}
Java to launch test:
DesiredCapabilities capabilities = DesiredCapabilities.safari();
capabilities.setPlatform(Platform.MAC);
capabilities.setBrowserName("safari");
capabilities.setVersion("9");
webDriver = new RemoteWebDriver(new URL("http://myipwashere:4445/wd/hub"), capabilities);
Edit: There are 5 safari nodes available on my grid, none are being used.
I must be overlooking something, any help would be greatly appreciated!
Thanks in advance.
After much trial and error, the URL being passed to the remotewebdriver was incorrect only for Safari. Hopefully this will help someone that has a similar problem in the future.
Thanks RemcoW for all of your help.