locked
Gmail's new Login Screen and Next button RRS feed

  • Question

  • Hi,

    I was writing my coded UI test in visual studio 2013(update 5) & my browser is ie 11.In one of my specific coded UI method, it redirects from my application(https://dev.nvisionoffice.com/) to gmail( www.gmail.com ) where it try to find some specific mails ,delete them and logout.I need to do this for two times one by one (for two gmail account) .it was working great with old gmail screen.But after when the new gmail login screen comes in , it fails at a specific point.

    After redirecting to gmail(from my application), it put the email in the email textbox.then click next button.After clicking this next button it just showing my applications login screen instead of the password textbox of gmail. it is not happening all the time but it happens few time and my test method fails.I don't know why it is happening.But One thing i am confused about is my application & gmail, both have password textbox with the same name 'password'(one has uppercase), but their parent element are different.

    After redirecting to gmail, my code(signin code) is given bellow

    public void SignIn(string gUserName, string gPassword)
            {

    BrowserWindow.ClearCookies();    
                BrowserWindow.ClearCookies();

    var browser = new BrowserWindow(); //browser.TechnologyName = "MSAA"; browser.SearchProperties.Add(UITestControl.PropertyNames.ClassName, "IEFrame", UITestControl.PropertyNames.ControlType, "Window", UITestControl.PropertyNames.Name, "Gmail"); var divContainer = new HtmlDiv(browser); divContainer.SearchProperties[HtmlDiv.PropertyNames.Id] = "view_container"; divContainer.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); //Put email var emailEdit = new HtmlEdit(divContainer); emailEdit.SearchProperties["Id"] = "identifierId"; emailEdit.SearchProperties["Name"] = "identifier"; emailEdit.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); if(emailEdit.TryFind() && emailEdit.WaitForControlReady()) { if(!emailEdit.ReadOnly) { emailEdit.Text = gUserName; } } var divNext = new HtmlDiv(divContainer); divNext.SearchProperties["Id"] = "identifierNext"; if(divNext.TryFind() && divNext.WaitForControlReady()) { var divNextInner = new HtmlSpan(divNext); divNextInner.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Next"; divNextInner.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); Mouse.Click(divNextInner); Playback.Wait(5000); } //Put password var passEdit = new HtmlEdit(divContainer); passEdit.SearchProperties["Name"] = "password"; passEdit.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); if(passEdit.TryFind() && passEdit.WaitForControlReady()) { passEdit.Text = gPassword; var divSignIn = new HtmlDiv(divContainer); divSignIn.SearchProperties["Id"] = "passwordNext"; if(divSignIn.TryFind() && divSignIn.WaitForControlReady()) { var divNextInner1 = new HtmlSpan(divSignIn); divNextInner1.SearchProperties[HtmlSpan.PropertyNames.InnerText] = "Next"; divNextInner1.SearchConfigurations.Add(SearchConfiguration.AlwaysSearch); Mouse.Click(divNextInner1); Playback.Wait(3000); } }

    }

    Can you please help me, it is urgent.

    Best Regards

    sabbir

    Monday, May 15, 2017 3:22 PM

Answers

  • Hi friend,

    Thanks for your post. And sorry for the delay because of some issues happened to MSDN forums days ago, your thread just showed up in our forum today. We apologize if this brought your any inconvenience.

    I tested it your code in my end, add the code of launched IE with Gmail page

    BrowserWindow.Launch("http://www.gmail.com");

     and specified the name and password with my google account, it works fine. 

     Only every time I have to clear the browser's history data or it will redirect to my account page instead.

    >> After clicking this next button it just showing my applications login screen instead of the password textbox of gmail.

    In my side, the code did not involve in you web application, so I did not have this issue after testing many times.

    I have to say, the script of test code you wrote is perfect.  And the issue is not caused by the test code apparently. The issue will show up no matter through coded ui testing or manually operation.

    So I suggest you check if it's related to redirect URL in your web application or something like that.

    I hope above could be helpful.

    Best regards,

    Fletch

     


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    • Edited by Fletch Zhou Thursday, May 18, 2017 12:54 PM
    • Marked as answer by SabbirSpider Thursday, May 18, 2017 2:36 PM
    Thursday, May 18, 2017 12:53 PM
  • Hello Fletch Thanks for you reply No one was answering my question.Then i set trace and found that it was making a problem in the second time login when i redirected from my application. First time, it is not creating a problem because i did not redirect , just launch the gmail url.so i did the same thing and problem gone. It can be an issue with my application.But previous code was working with old gmail login page & there i was redirecting from my same application. Thanks again.Giving full credit to you . sabbir
    • Marked as answer by SabbirSpider Thursday, May 18, 2017 2:36 PM
    Thursday, May 18, 2017 2:36 PM

All replies

  • Hi friend,

    Thanks for your post. And sorry for the delay because of some issues happened to MSDN forums days ago, your thread just showed up in our forum today. We apologize if this brought your any inconvenience.

    I tested it your code in my end, add the code of launched IE with Gmail page

    BrowserWindow.Launch("http://www.gmail.com");

     and specified the name and password with my google account, it works fine. 

     Only every time I have to clear the browser's history data or it will redirect to my account page instead.

    >> After clicking this next button it just showing my applications login screen instead of the password textbox of gmail.

    In my side, the code did not involve in you web application, so I did not have this issue after testing many times.

    I have to say, the script of test code you wrote is perfect.  And the issue is not caused by the test code apparently. The issue will show up no matter through coded ui testing or manually operation.

    So I suggest you check if it's related to redirect URL in your web application or something like that.

    I hope above could be helpful.

    Best regards,

    Fletch

     


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.



    • Edited by Fletch Zhou Thursday, May 18, 2017 12:54 PM
    • Marked as answer by SabbirSpider Thursday, May 18, 2017 2:36 PM
    Thursday, May 18, 2017 12:53 PM
  • Hello Fletch Thanks for you reply No one was answering my question.Then i set trace and found that it was making a problem in the second time login when i redirected from my application. First time, it is not creating a problem because i did not redirect , just launch the gmail url.so i did the same thing and problem gone. It can be an issue with my application.But previous code was working with old gmail login page & there i was redirecting from my same application. Thanks again.Giving full credit to you . sabbir
    • Marked as answer by SabbirSpider Thursday, May 18, 2017 2:36 PM
    Thursday, May 18, 2017 2:36 PM
  • Hi friend, 

    I'm glad that you issue has been resolved. 

    We apologize that we replied so late, because some issue happened to MSDN forum days ago which caused we could not see some threads in forum at that moment in our end. 

    Your are always welcome to post here. 

    Have a nice day!

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Wednesday, May 24, 2017 2:17 AM
    Wednesday, May 24, 2017 2:17 AM