package Browser;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
public class BrowserWindow {
@Test
public void MyTest() {
System.out.println("Welcome to google"); //* Console output
System.out.println("Get Driver");
System.setProperty("webdriver.gecko.driver", "C:\\Users\\steven\\Desktop\\Desktop\\SOFTWARE\\geckodriver.exe");
System.out.println("New Driver");
System.out.println("Web Driver Launch");
WebDriver driver = new FirefoxDriver();
System.out.println("Going to google");
driver.get("https://www.google.com");
System.out.println("Application opened");
System.out.println("Page Title is : "+driver.getTitle());
System.out.println("close");
//**driver.close();
}
}
[RemoteTestNG] detected TestNG version 6.14.2
Welcome to google
Get Driver
New Driver
Web Driver Launch
1528208743387 geckodriver INFO geckodriver 0.20.1
1528208743415 geckodriver INFO Listening on 127.0.0.1:22621
1528208744134 mozrunner::runner INFO Running command: "C:\\Program Files\\Mozilla Firefox\\firefox.exe" "-marionette" "-profile" "C:\\Users\\steven\\AppData\\Local\\Temp\\rust_mozprofile.EByQlzFMRba1"
Unable to read VR Path Registry from C:\Users\steven\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\steven\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\steven\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\steven\AppData\Local\openvr\openvrpaths.vrpath
Unable to read VR Path Registry from C:\Users\steven\AppData\Local\openvr\openvrpaths.vrpath
1528208750102 Marionette INFO Listening on port 8199
1528208750514 Marionette WARN TLS certificate errors will be ignored for this session
Jun 05, 2018 10:25:50 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Going to google
Application opened
Page Title is : Google
close
===============================================
Suite
Total tests run: 1, Failures: 0, Skips: 0
===============================================
C:\Users\steven\eclipse-workspace\JenkinsSeleniumWindow>run.bat
C:\Users\steven\eclipse-workspace\JenkinsSeleniumWindow>java -cp bin;lib/* org.testng.TestNG testng.xml
Welcome to google
Get Driver
New Driver
Web Driver Launch
===============================================
Suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================
I got this in TestNG Reports:....
MyTest
java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkState(ZLjava/lang/String;Ljava/lang/Object;)V
at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:136)
at org.openqa.selenium.firefox.GeckoDriverService.access$000(GeckoDriverService.java:42)
at org.openqa.selenium.firefox.GeckoDriverService$Builder.usingFirefoxBinary(GeckoDriverService.java:136)
at org.openqa.selenium.firefox.FirefoxDriver.toExecutor(FirefoxDriver.java:165)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:125)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
at Browser.BrowserWindow.MyTest(BrowserWindow.java:23)
... Removed 24 stack frames
Whats going on any ideas to fix this?