Cannot run my selenium tests on the edge webDriver - java

I'm using a macOS, I installed the Edge webdriver on it, configured its path on my selenium framework
But I got this error:
org.openqa.selenium.WebDriverException: unknown error: cannot find Microsoft Edge binary
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'MacBook-Pro-de-Sabrine-2.local', ip: 'fe80:0:0:0:4c2:e6bc:d2ff:348c%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.5', java.version: '1.8.0_191'
Driver info: driver.version: EdgeDriver

So you are using MAC. The problem is that the browser needs to be installed on your system in order to run it.
So if somehow you have installed it use the below code:
Code:
System.setProperty("webdriver.edge.driver","/YOUR_PATH");
WebDriver driver = new EdgeDriver();
driver.get("http://www.google.com");
OR
System.setProperty("webdriver.edge.driver","YOUR_PATH");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("/YOUR_PATH");
EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);
WebDriver driver = new EdgeDriver(edgeOptions);
driver.get("http://www.google.com");

Related

Unable to Create New session with Microsoft Edge with desired capabilities

I am trying to create a Java test using Edge Webdriver and Edge version 86 (available to download).
I am using EdgeOptions as suggested on many threads here
System.setProperty("webdriver.edge.driver", "C:\\edgedriver\\msedgedriver.exe");
EdgeOptions edgeOptions = new EdgeOptions();
WebDriver driver = new EdgeDriver(edgeOptions);
driver.get("https://bing.com");
I get the below error when i execute the script
Error:
Starting MSEdgeDriver 86.0.622.43 (aecc56815110f44c6552813fdd27a416872192c8) on port 35032
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping MSEdgeDriver safe.
MSEdgeDriver was started successfully.
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}], required capabilities = Capabilities [{}]
Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800'
System info: host: 'XXXXXXXXXX', ip: 'XXXXXXX', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: EdgeDriver

Selenium Java on MAC - Edgedriver is not working

Hi people: I have the next situation.
I want to run automation with Selenium, specifically with Microsoft Edge on Mac.
I have installed Version 77.0.235.15 (Official build) Beta (64-bit)
Edgedriver: Version: 77.0.235.15
The rest of the browsers run with no drama, but Edgedriver fails.
System.setProperty("webdriver.edge.driver", Constants.EdgeDriverPath);
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary(Constants.EdgeDriverPath);
EdgeOptions edgeOptions = new EdgeOptions().merge(chromeOptions);
driver = new EdgeDriver(edgeOptions);
The error is the next:
Caused by: org.openqa.selenium.WebDriverException: unknown error: Microsoft Edge failed to start: exited abnormally.
(unknown error: DevToolsActivePort file doesn't exist)
(The process started from MicrosoftEdge location src/test/resources/drivers/mac/msedgedriver is no longer running, so MSEdgeDriver is assuming that Microsoft Edge has crashed.)
Build info: version: '3.11.0', revision: 'e59cfb3', time: '2018-03-11T20:26:55.152Z'
System info: host: 'CL-IT00331', ip: '192.168.0.12', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.3', java.version: '1.8.0_211'
Driver info: driver.version: EdgeDriver
remote stacktrace: 0 msedgedriver 0x000000010bc29f99 msedgedriver + 8023961
Could you please help me?

SessionNotCreatedException: Unable to find a matching set of capabilities using SeleniumGrid with GeckoDriver Firefox through Java

Below code I written to open www.google.com under selenium standalone Grid environment. During the execution it shows error
CONFIGURATION:
OS: WINDOWS 10
BROWSER : FireFox (66.0.3)
Selenium Standalone Command:
java -Dwebdriver.gecko.driver=C:\eClipse\jar\Selenium\geckodriver\geckodriver.exe -jar selenium-server-standalone-3.141.59.jar -role standalone
ERROR:
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'QAT2', ip: '10.1.6.79', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: driver.version: unknown
I try to google this exception but not find any clue to solve it. Can I have any solution for this.
CODE:
public class GridSetup {
private String baseUrl ;
private String nodeURL ;
public WebDriver wDriver ;
public static void main() throws MalformedURLException{
baseUrl = "http://www.google.com";
nodeURL = "http://localhost:4444/wd/hub";
System.setProperty("webdriver.gecko.driver","C:\\eClipse \\geckodriver.exe");
DesiredCapabilities caps = DesiredCapabilities.firefox();
System.out.println( "#####################");
caps.setBrowserName("firefox");
caps.setCapability("marioneete", true);
caps.setPlatform(Platform.WIN10);
caps.setVersion("66.0.3");
wDriver = new RemoteWebDriver(new URL(nodeURL), caps);
wDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
wDriver.get(baseUrl);
}
}
This error message...
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unable to find a matching set of capabilities
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'QAT2', ip: '10.1.6.79', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: driver.version: unknown
...implies that the GeckoDriver was unable to initiate/spawn a new WebBrowsing Session i.e. Firefox Browser session.
Your main issue is the incompatibility between the version of the binaries you are using as follows:
Your Selenium Client version is 3.141.59.
Your JDK version is 1.8.0_91 which is pretty ancient.
So there is a clear mismatch between the JDK v8u91 , Selenium Client v3.141.59.
Solution
Upgrade JDK to recent levels JDK 8u202.

Problems executing selenium on ubuntu server

I am trying to execute Selenium on Ubuntu Server but I have always problem with driver version. I don't know more options to check it so I am here to try to solve this.
First the environment:
Maven : Apache Maven 3.3.9
Java : 1.8
Chrome : Google Chrome 59.0.3071.115
Chrome driver : ChromeDriver 2.30.477691
When I try to execute mvn clean test, it returns this ERROR:
Build info: version: '3.4.0', revision: 'unknown', time: 'unknown'
System info: host: 'ubuntu-2gb-lon1-01', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-81-generic', java.version: '1.8.0_131'
Driver info: driver.version: ChromeDriver
The simple java code is this:
System.setProperty("webdriver.chrome.driver", "chromedriver");
WebDriver driver = new ChromeDriver();
driver.get("https://google.es");
driver.quit();
Could anyone help to me to install a Chrome driver version to solve this?
I think that I am not doing this correctly.
Regards!
System.setProperty("webdriver.chrome.driver", "Driver Path");
Here you have to pass the path where your driver is located in your disk.

Selenium Webdriver Unable to create new remote session on Firefox gecko driver

I am using selenium 2.53.1 and Mozilla 37.0. While executing script throws exception as below:
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{marionette=true, browserName=Firefox, moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=null}, version=, platform=ANY}], required capabilities = Capabilities [{moz:firefoxOptions={binary=Optional.empty, args=[], legacy=null, logLevel=null, prefs={}, profile=null}}]
Build info: version: 'unknown', revision: '5234b32', time: '2017-03-10 09:00:17 -0800'
System info: host: 'JAYANT-PC', ip: '192.168.132.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
How can avoid this Error?
Your gecko driver and selenium versions are possibly mismatched. Please refer to this github thread: https://github.com/SeleniumHQ/selenium/issues/3630
update your firefox and use selenium 3.3.1 and geckodriver 0.15.0,it will work

Categories