none
Testing codedui test in chrome and firefox RRS feed

  • Question

  • Hi experts,...

    I created a codedui test method which runs in IE 10. 

    I installed "Selenium components for Coded UI Cross Browser Testing" and Firefox 47.0.1 but the test does not work.

    My code test:

    public void CodedUITestMethod1()
           {
               BrowserWindow.CurrentBrowser = "Firefox";
               this.UIMap.test1();
               // To generate code for this test, select "Generate Code for Coded UI Test" from the shortcut menu and select one of the menu items.
           }

    The mistake is:

    The CodedUITestProject1.CodedUITest1.CodedUITestMethod1 test method produced the exception:
    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The browser window can not be found with 'Browse Stores' in the title.

    I do not about another configuration so I can't solve the problem.


    • Edited by neonash Wednesday, August 2, 2017 11:23 PM
    Wednesday, August 2, 2017 11:22 PM

Answers

  • Hi friend,

    Thanks for your feedback.

    I also tested it in my end and got the same result as yours. <sub></sub><sup></sup><strike></strike>

    As MS only published the hotfix for VS2015 update 3, if you really need run coded UI test to open Firefox or chrome, so I suggest you use VS2015 update 3 and install the hotfix in posted above, or VS2017 which could work with no problem.

    Thanks for your understanding.

     

    Best regards,

    Fletcher


    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 Friday, August 4, 2017 4:07 AM
    • Proposed as answer by Fletch Zhou Monday, August 7, 2017 7:00 AM
    • Marked as answer by neonash Thursday, August 10, 2017 2:55 PM
    Friday, August 4, 2017 4:07 AM

All replies

  • Hi friend,

     

    >> Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The browser window can not be found with 'Browse Stores' in the title.

    Based on this exception, it means the UI test control not found in the browser window. I think the problem caused by the operation in the test1 method. If you could share the test1 method details or the sample code, this will help solve your problem better. 

    Please try to the following code to check if Firefox and Chrome browser are turned on correctly.

    BrowserWindow.CurrentBrowser = "firefox";
    
    BrowserWindow.Launch(new System.Uri("http://www.bing.com"));

    If it runs successfully which means that selenium components is ok . If it fails to open the browser, please tell us the error message, then we could help you analyze the problem.

    Btw, what's the VS version in your side? 

    If it's VS2015 please install this hotfix and have a try.

    FIX: Issues with action recording using Microsoft Test Manager and Coded UI tests using Visual Studio

    Looking forward to your reply.

     

    Best regards,

    Fletcher


    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, August 3, 2017 5:20 AM
    Thursday, August 3, 2017 4:23 AM
  • Hi

    I use Visual Studio 2013 with Update 5

    The code in the this.UIMap.test1() is:

    public void test1()
           {
                #region Variable Declarations
               HtmlCell uIIgualDiferenteMayorMCell = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument.UITmpTable.UIIgualDiferenteMayorMCell;
               HtmlComboBox uICriterioComboBox = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument.UICriterioComboBox;
               HtmlHyperlink uIComerciosComercioBanHyperlink = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument.UIComerciosComercioBanHyperlink;
               HtmlComboBox uIValorComboBox = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument.UIValorComboBox;
               HtmlDocument uIConsultarComerciosDocument = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument;
               HtmlInputButton uIBuscarButton = this.UIConsultarComerciosWiWindow.UIConsultarComerciosDocument.UIBuscarButton;
                #endregion
     
               // Click 'IgualDiferenteMayorMayor IgualMenorMenor' cell
               Mouse.Click(uIIgualDiferenteMayorMCell, new Point(9313));
     
               // Select 'Estado del Comercio (*)' in 'Criterio' combo box
               uICriterioComboBox.SelectedItem = this.test1Params.UICriterioComboBoxSelectedItem;
     
               // Set flag to allow play back to continue if non-essential actions fail. (For example, if a mouse hover action fails.)
               Playback.PlaybackSettings.ContinueOnError = true;
     
               // Mouse hover '/comercios/Comercio/BandejaListarComercio' link at (1, 1)
               Mouse.Hover(uIComerciosComercioBanHyperlink, new Point(11));
     
               // Reset flag to ensure that play back stops if there is an error.
               Playback.PlaybackSettings.ContinueOnError = false;
     
               // Select 'Suspendido' in 'Valor' combo box
               uIValorComboBox.SelectedItem = this.test1Params.UIValorComboBoxSelectedItem;
     
               // Click 'Consultar Comercios' document
               Mouse.Click(uIConsultarComerciosDocument, new Point(347283));
     
               // Click 'Buscar' button
               Mouse.Click(uIBuscarButton, new Point(2317));
           }
           

    When I run this code: 

    BrowserWindow.CurrentBrowser = "firefox"; BrowserWindow.Launch(new System.Uri("http://www.bing.com"));

    The application launchs firefox but the browser window is closed after 1 second.

    Thursday, August 3, 2017 3:23 PM
  • Hi friend,

    Thanks for your feedback.

    I also tested it in my end and got the same result as yours. <sub></sub><sup></sup><strike></strike>

    As MS only published the hotfix for VS2015 update 3, if you really need run coded UI test to open Firefox or chrome, so I suggest you use VS2015 update 3 and install the hotfix in posted above, or VS2017 which could work with no problem.

    Thanks for your understanding.

     

    Best regards,

    Fletcher


    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 Friday, August 4, 2017 4:07 AM
    • Proposed as answer by Fletch Zhou Monday, August 7, 2017 7:00 AM
    • Marked as answer by neonash Thursday, August 10, 2017 2:55 PM
    Friday, August 4, 2017 4:07 AM
  • Hi

    I understand your answer

    Thanks by your response

    Best regards,

    NEOAGUIL

    Thursday, August 10, 2017 2:55 PM