Failure when running in CMD

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Failure when running in CMD

Steven Bellos
OS:
Windows 10 - 1803
Selenium Version:
3.12.0
Browser:
Firefox Quantum 60.0.1 (64-bit)


Code in Eclipse IDE Version: Oxygen.3a Release (4.7.3a) - Build id: 20180405-1200
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();

   
}

}


From Eclipse Console I get this:
[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
===============================================


From Command Prompt I get this:
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
===============================================


In Command Prompt it seems to fail at Web Driver Launch at WebDriver driver = new FirefoxDriver();

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?



--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/6c3b3b92-7931-44b7-b1fd-8372d7777967%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.