简体   繁体   中英

Getting error while integration Selenium test cases java with Azure devops

Getting error as below while Running mvn clean test -Dsurefire.suiteXmlFiles=todo.xml command

Not able to integrate selenium test cases in java

    chrome browser set
    
    Win10 set
    
    [ERROR] Tests run: 8, Failures: 1, Errors: 0, Skipped: 7, Time elapsed: 12.928 s <<< FAILURE! - in TestSuite
    
    [ERROR] initialize(todo.Functional.todo)  Time elapsed: 12.647 s  <<< FAILURE!
    org.openqa.selenium.remote.UnreachableBrowserException: 
    
    Could not start a new session. Possible causes are invalid address of the remote server or browser start-
    up failure.
    
    Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
    System info: host: 'WIN-VRELINQ0UUU', ip: '192.168.0.103', os.name: 'Windows Server 2019', os.arch: 'amd64', os.version: '10.0', java.version: '11.0.10'
    
    Driver info: driver.version: RemoteWebDriver
    Caused by: java.net.UnknownHostException: No such host is known (selenium-node-chrome)

    [INFO] 
    [INFO] Results:
    [INFO] 
    [ERROR] Failures: 
    [ERROR]   todo>testBase.initialize:354 � UnreachableBrowser Could not start a new sessio
    [INFO] 
    [ERROR] Tests run: 8, Failures: 1, Errors: 0, Skipped: 7

Always post your code so people can see the relevance of the errors you're getting. However, as a newbie, I'm still going to give it a shot.

org.openqa.selenium.remote.UnreachableBrowserException

Your RemoteWebDriver cannot connect to the remote web driver at the specified URL.

java.net.UnknownHostException: No such host is known (selenium-node-chrome)

This looks like you're using a Docker container name for the hostname of the location of your remote webdriver.

This is what it might look like:

URL driverLocation = new URL("http://remote.webdriver.lives.here:4444/wd/hub");

ChromeOptions options = new ChromeOptions();
options.addArguments("--headless");
// more options

driver = new RemoteWebDriver(driverLocation, options);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM