Thursday 18 May 2017

How to handle elements on Gmail Sign In Modal window in a web application using node js wd

I am writing test scripts in node js (wd) for my web application and in that I am having Google sign in link , when i click on that , a modal window opens up for entering email and password.

I used wait also but it gives me error that "no such element". So, How can I get control for that modal window. Also, I have used browser.switchTo().frame("Sign in - Google Accounts - Google Chrome") function but throws error that browser.switchTo() is not a function.

Here is some code -

browser.elementByXPath("//span[contains(text(),'Sign in')]", function(err, el) {
        el.click();
        wait4(10000);
        /*browser.switchTo().frame("Sign in - Google Accounts - Google Chrome");*/
        browser.elementById("identifierId", function(err, el) {
        console.log(el,err);
        el.sendKeys("username");      
    })



via Monika Gambhir

No comments:

Post a Comment