0

I wrote the sample selenium script to perform headless browser testing on a google page.

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());

    }
}

The output is what I have expected.

But, when I tried the same script on my AngularJS application (making necessary modification in URL and xpaths), It is not at all executing the script. The output is shown as blank.

What is the reason the script is success in case of Google page but not on the AngularJS application?

Note: To make sure the script is correct, I tested the AngularJS application on FF. It is working fine.

TodayILearned
  • 1,440
  • 4
  • 20
  • 28

0 Answers0