Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/selenium/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用Selenium testng在IE浏览器中启动网站时出错_Java_Selenium_Testng - Fatal编程技术网

Java 使用Selenium testng在IE浏览器中启动网站时出错

Java 使用Selenium testng在IE浏览器中启动网站时出错,java,selenium,testng,Java,Selenium,Testng,我无法使用testng在IE浏览器上启动Google。请在下面查找代码 package Demoqa_Test; import org.openqa.selenium.WebDriver; import org.openqa.selenium.ie.InternetExplorerDriver; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.Be

我无法使用testng在IE浏览器上启动Google。请在下面查找代码

package Demoqa_Test;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class Demoqa_Registration {

public WebDriver Driver;

@Test
public void Regis() 
{
    // Driver.navigate().to("http://www.google.com");
    Driver.get("http://www.google.com");
    String strPageTitle = Driver.getTitle();
    System.out.println("Page Title:- "+strPageTitle);
    // Assert.assertEquals(expectedTitle,actualTitle);
    Driver.manage().window().maximize();
    System.out.println("Browser Opened");
}  // Lanching Google

@BeforeClass
public void Ready() throws InterruptedException
{
    System.out.println("*******************");
    System.out.println("launching IE browser");
    System.setProperty("webdriver.ie.driver","C:\\Users\\IBM_ADMIN\\workspace\\IEDriverServer_Win32_2.53.0\\IEDriverServer.exe");
    WebDriver Driver = new InternetExplorerDriver();
} // Launching IE browser

@AfterClass
public void Signout() {
    if(Driver!=null) {
        System.out.println("Closing IE browser");
        Driver.quit();
    } // After class
}

}
它正在启动IE并给出错误,因为“这是WebDriver服务器的初始起始页”


有人能帮忙吗?谢谢。

您的问题与变量的范围有关。我建议你在继续之前先了解这一点:谢谢你,先生。这很有帮助。这是我在密码上的错误。我找到了,程序现在可以执行了。非常感谢你。