0

Getting ниже ошибки При попытке открыть селен драйвер FireFox для моего локального URL:Привет им получать ниже ошибки, когда им пытаются запустить селен через затмении для моего локального тестирования URL

INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end 
org.openqa.selenium.remote.ProtocolHandshake createSession 
INFO: Detected dialect: W3C 
ession ID: 107f76f0-251f-4d62-9308-2968ed6e354f 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) 
    at java.lang.reflect.Constructor.newInstance(Unknown Source) 
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:127) 
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:93) 
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:42) 
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163) 
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) 
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) 
    at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:322) 
    at Gmail_login.main(Gmail_login.java:14) 

Код

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 
import org.openqa.selenium.WebElement; 
import org.openqa.selenium.By; 
public class Gmail_login { 

    public static void main(String[] args) { 
     // TODO Auto-generated method stub 
    // objects and variables instantiation 
      System.setProperty("webdriver.gecko.driver", "C:\\Selenium\\geckodriver.exe"); 
      WebDriver driver = new FirefoxDriver(); 
      String appUrl = "https://localhost/qwer"; 
    // launch the firefox browser and open the application url 
      driver.get(appUrl); 
    //maximize the browser window 
      driver.manage().window().maximize(); 
    //declare and initialize the variable to store the expected title of the webpage. 
      String expectedTitle = "Web Login Service"; 
    //fetch the title of the web page and save it into a string variable 
      String actualTitle = driver.getTitle(); 
    //compare the expected title of the page with the actual title of the page and print the result 
      if (expectedTitle.equals(actualTitle)) 
      { 
       System.out.println("Verification Successful - The correct title is displayed on the web page."); 
      } 
      else 
      { 
      System.out.println("Verification Failed - An incorrect title is displayed on the web page."); 
      } 
    // enter a valid username in the email textbox 
      WebElement username = driver.findElement(By.id("username")); 
      username.clear(); 
      username.sendKeys("[email protected]"); 
       // enter a valid password in the password textbox 
      WebElement password = driver.findElement(By.id("password")); 
      password.clear(); 
      password.sendKeys("Welcome"); 
       // click on the Sign in button 
      WebElement SignInButton = driver.findElement(By.name("_eventId_proceed")); 
      SignInButton.click(); 
       // close the web browser 
      driver.close(); 
      System.out.println("Test script executed successfully."); 
        // terminate the program 
      System.exit(0); 

    } 

} 
+0

Pls, дайте мне знать, я получаю выше ошибки. Это будет действительно полезно для начинающих, таких как me.Thanks. – Karthikbalaji

ответ

1

Драйвер Firefox выдает эту ошибку, если URL недоступен, например, доменное имя не может быть разрешено или сервер блокирует соединение. Он будет работать, если вы установите веб-сервер на свой локальный хост и подадите некоторый контент для этого URL-адреса. Вы можете попробовать переключить firefox на chrome, который не генерирует исключение для этого сценария. Вы также можете написать блок try-catch вокруг своего оператора driver.get().

0

Это сообщение INFO, и люди просто видят, что происходит. Это не ошибка и не о чем беспокоиться.

это сообщение возникает при использовании версии выше selenium3.0.0 и geckodriver

это не остановит выполнение скрипта.

Смежные вопросы