Internet explorer tools > internet options


  • Hi there,


    I am trying to create an automated test that will navigate to IE > Tools > Internet Options before adding a series of 8 languages. I am experiencing problems right away as the playback / record facility is not able to pick up the "tools" button from the IE window. Any tips?

    Monday, July 18, 2011 2:01 PM

All replies

  • I have tried hand coding the tool by declaring the browser window, then the toolbar, and then the tools hyperlink using the following code:

                #region Identify iWFM Top Level Window
                BrowserWindow iWFMWindow = new BrowserWindow();
                iWFMWindow.SearchProperties[BrowserWindow.PropertyNames.FriendlyName] = "";
                iWFMWindow.SearchProperties[BrowserWindow.PropertyNames.ControlType] = "Window";
                iWFMWindow.SearchProperties[BrowserWindow.PropertyNames.TechnologyName] = "MSAA";
                iWFMWindow.SearchProperties[BrowserWindow.PropertyNames.ClassName] = "IEFrame";
                iWFMWindow.SearchProperties[BrowserWindow.PropertyNames.Name] = "";

                #region Identify IE toolbar
                WinToolBar toolBar = new WinToolBar();
                toolBar.SearchProperties[WinToolBar.PropertyNames.Name] = "Command Bar";
                toolBar.SearchProperties[WinToolBar.PropertyNames.ClassName] = "ToolbarWindow32";
                toolBar.SearchProperties[WinToolBar.PropertyNames.ControlType] = "ToolBar";
                //Assert.AreEqual(Convert.ToBoolean("True"), toolBar.Exists);

                #region Identify and Click 'Tools' button
                WinButton toolsButton = new WinButton(toolBar);
                toolsButton.SearchProperties[WinButton.PropertyNames.ControlType] = "Button";
                toolsButton.SearchProperties[WinButton.PropertyNames.Name] = "Tools";
                toolsButton.SearchProperties[WinButton.PropertyNames.ClassName] = "ToolbarWindow32";


    But am receiving the following error message:

    Test method SplashPage.CodedUITest1.CodedUITestMethod1 threw exception:
    Microsoft.VisualStudio.TestTools.UITest.Extension.UITestControlNotFoundException: The playback failed to find the control with the given search properties. Additional Details:
    TechnologyName:  'MSAA'
    ControlType:  'Button'
    Name:  'Tools'
    ClassName:  'ToolbarWindow32'
     ---> System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.

    Monday, July 18, 2011 2:47 PM
  • What IE version are you using. Please follow the below procedure and see if your code is correct.

    Open VS and create a new codedui test and record your actions on IE.

    Generate the code. Verify the generated code with your Hand Written Code. See if there is some difference.

    From IE version to version you may see some changes in the UI and control properties. So generate code using Coded UI test builder and verify.

    ---Mark this post if this Answers or Helps---
    Monday, July 18, 2011 6:04 PM
  • I am using IE8. When I have tried to handcode I reach a point where I wish to click the "languages" button in the Internet Options screen and dependant on the languages already there I wish to add a list of 8 languages. The problem now is that I cannot access the language listbox text property as a whole and instead have to make assertions on the individual records in the box, this is a problem because i do not know which order these languages will be displayed in.
    Tuesday, July 19, 2011 9:10 AM