Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/blackberry/2.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
无头浏览在google页面上工作,但在AngularJS应用程序上不工作_Angularjs_Selenium_Headless Browser - Fatal编程技术网

无头浏览在google页面上工作,但在AngularJS应用程序上不工作

无头浏览在google页面上工作,但在AngularJS应用程序上不工作,angularjs,selenium,headless-browser,Angularjs,Selenium,Headless Browser,我编写了示例selenium脚本,在谷歌页面上执行无头浏览器测试 public class Headless { public static void main(String[] args) throws InterruptedException { HtmlUnitDriver unitDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX_24); // WebDriver unitDriver

我编写了示例
selenium
脚本,在谷歌页面上执行
无头浏览器测试

public class Headless 
{

    public static void main(String[] args) throws InterruptedException
    {
        HtmlUnitDriver unitDriver = new HtmlUnitDriver(BrowserVersion.FIREFOX_24);
        // WebDriver unitDriver=new FirefoxDriver();
         unitDriver.manage().window().maximize();
         System.out.println("window maximise");

        unitDriver.get("https://www.google.co.in/?gfe_rd=cr&ei=k36cVsa6OubI8Aec14bICQ&gws_rd=ssl");
        Thread.sleep(20000);
        System.out.println("at google page");
        System.out.println("Title of the page is -> " + unitDriver.getTitle());

        //unitDriver.findElement(By.id("gb_70")).click();
        unitDriver.findElement(By.xpath("//a[@id='gb_70']")).click();
        Thread.sleep(20000);

        System.out.println("Title of the page is -> " + unitDriver.getTitle());

    }
}
输出是我所期望的

但是,当我在我的
AngularJS
应用程序上尝试相同的脚本(对URL和XPath进行必要的修改)时,它根本没有执行脚本。 输出显示为空白

在Google页面上脚本成功的原因是什么,而不是在
AngularJS
应用程序上


注意:
为了确保脚本正确,我在FF上测试了AngularJS应用程序。它工作得很好。

您是否有一个公共URL,我们可以在其中复制相同的内容issue@MrunalGosar我将分享示例URL。