latest chrome, firefox browsers are not working with selenium 3.0 - selenium-webdriver

I am using firefox 48 and chrome Version 52.0.2743.116 m (64-bit) with selenium webdriver 3.0. Used geckodriver for firefox also.
System.setProperty("webdriver.firefox.marionette", "D:\\Software\\geckodriver\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();//for firefox
System.setProperty("webdriver.chrome.driver", "D:\\Software\\chromedriver_win32\\chromedriver.exe");
WebDriver driver = new ChromeDriver();//for chrome
I am getting following error:
Unable to connect to host 127.0.0.1 on port 7055 (in case of
firefox)
Null pointer exception (in case of chrome)

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.

Insecure connection error in Firefox using Selenium webdriver using java

FF: 52.6 ESR version
Selenium : 3.5.2
Gecko driver : v0.15
FirefoxProfile profile = new FirefoxProfile();
System.setProperty("webdriver.gecko.driver", "D:/geckodrivers/geckodriver-v0.15.0-win64/geckodriver.exe");
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(true);
driver = new FirefoxDriver(profile);
I am using this code and still getting insecure connection error. If I use capabilities, the url itself is not opening in FF browser. Issue not replicating in Chrome and IE.

Get error org.openqa.selenium.firefox.NotConnectedException when running the selenium code

getting the below error
org.openqa.selenium.firefox.NotConnectedException
Firefox : 32.0
Eclipse : Version: Neon.1a Release (4.6.1)
Upgrade your firefox You need to install geckodriver from this link:
Gecko driver download from here
and then set the setProperty()
System.setProperty("webdriver.gecko.driver", "E:\\software and tools\\geckodriver.exe");
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
If you are using selenium jar 2.53 and browser firefox 45.0, then no need to set gecko driver:
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");

selenium 2.45 with mac 10.11 and safari 9 not able to run

I am not able to run selenium with mac 10.11 and safari 9.
Error is : org.openqa.selenium.WebDriverException: SafariDriver requires Safari 10 running on OSX El Capitan or greater.
Configuration I used are :
Selenium : 2.45.0; 2.48.0
Safari browser version : 9.1.3
Mac OS 10.11.6 OS X El Capitan
Java JDK : 1.8
Safari extension I used is from 2.45 or 2.48 selenium from link http://selenium-release.storage.googleapis.com/index.html and have installed safari extension in safari. I am using maven to download selenium.
Any pointers is appreciated.
Well the exception says
org.openqa.selenium.WebDriverException: SafariDriver requires Safari 10 running on OSX El Capitan or greater.
And you said you are using:
Safari browser version : 9.1.3
I'd say you have to update your browser.
I was also facing issues in initiating safari browser on mac machine, and below solution helped me. I am using
Java 8,
Selenium Webdriver,
TestNG,
Page Object Model,
Page Factory in my GUI automation framework.
if (browserType.equals("safari")) {
// System.setProperty("webdriver.safari.driver", workingDir +
// "//driver//SafariDriverServer.exe");
System.setProperty("webdriver.safari.driver",
"/driver/SafariDriver.safariextz");
System.setProperty("webdriver.safari.noinstall", "true");
DesiredCapabilities desiredCapabilities = DesiredCapabilities
.safari();
SafariOptions safariOptions = new SafariOptions();
safariOptions.setUseCleanSession(true);
safariOptions.getUseCleanSession();
safariOptions.setUseCleanSession(true);
desiredCapabilities.setCapability(SafariOptions.CAPABILITY,
safariOptions);
// deleteCookies();
driver = new EventFiringWebDriver(new SafariDriver());
ThreadDriver.set(driver);
// driver.manage().window().setSize(new Dimension(1024, 850));
getDriver().manage().timeouts().implicitlyWait(3,
TimeUnit.SECONDS);
wait = new WebDriverWait(driver, 30);
}

Not able to automate Opera browser through Selenium WebDriver

I'm automating a web application which runs in 3 browsers, IE, Mozilla and Chrome.
Now when I try to run the same code in Opera with different capabilities, it opens Opera browser but in URL only data; is displayed and my tests are not running.
Here is my sample code:
DesiredCapabilities capabilities = DesiredCapabilities.operaBlink();
System.setProperty("webdriver.opera.driver", "C:\\Important\\Test\\web\\src\\test\\resources\\operadriver.exe");
driver = new OperaDriver(capabilities);
driver.manage().window().maximize();
I'm getting following error:
org.openqa.selenium.WebDriverException: Opera not reachable (Driver info: OperaDriver=0.2.0 (ba47709ed9e35ce26dbd960fb5d75be104290d96),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
I tried this with Windows 10, Selenium 3.5.2, Opera 52.0 and OperaDriver 2.35 and the following code works for me.
DesiredCapabilities capablities=DesiredCapabilities.opera();
System.setProperty("webdriver.opera.driver", "C:\\automation\\opera\\operadriver.exe");
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.setBinary("C:\\Program Files\\Opera\\launcher.exe");
capablities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
OperaDriver driver = new OperaDriver(capablities);
driver.get("https://www.google.com");
driver.findElement(By.name("q")).sendKeys("how to use opera with selenium");
Please Try with
DesiredCapabilities capabilities = DesiredCapabilities.opera();

Resources