Forum Discussion

m_essaid's avatar
Valued Contributor
7 years ago

How to deal with browser window

Hello guys,


I automate exes that uses a lot of theses windows. Theses ones don't allow an Edit field in which I can put a unc path. No, theses windows needs the use of mouse to select the appropriate folder.


Usually, my tests fail when I try to browse the right folder.


I do the following :

  - I do a "SetFocus"

  - I press "Home"

  - And I do successively as much "ClickItem" as I need to open child folder bu child folder until I select the right one.


Anyone has a better idea ? How do you deal with such browser dialog ?


Thank you

8 Replies

    • m_essaid's avatar
      Valued Contributor

      Hi shankar_r

      seems to be a great clue ! I tried it a little.

      I will tell you tomorrow after the night run.

    • m_essaid's avatar
      Valued Contributor

      Hi shankar_r, it seems to work very well.


      For an unknown reason in some of my environnements the ObjectIdentifier spaces are "spaces" when in others it's "underscores".


      I put a conditionnal mapping for each.


      Thank you very much...

  • m_essaid's avatar
    Valued Contributor



    I finaly resolved this issue by using a property of the component that manages the folder dialog.

    This component is, in my application, a TMS FolderDialog for Delphi.

    If I assign the .Directory value before beeing executed, it keeps this value by default.


    This is the best way to solve that, without asking anything to the dev team.


    Hopefuly this property is visible for the TestComplete robot. I it hadn't been visible, I would have modified this TMS component.

  • m_essaid's avatar
    Valued Contributor

    Hi there,


    I still have issues with theses kind of windows.

    I mean, in this example assume you have another folder just under "Office14" (so not visible)

    I choosed first the folder in the combobox

    Then I tried to select the invisible folder... and the test fails.


    Any ideas ?


    Thank you in advance,



    • dmiscannon's avatar
      Frequent Contributor

      Your first picture shows a Windows Explorer window which is handled differently than a combo box. If you want to work with Explorer, the code below (written in VBScript) worked for me. There is probably a better way to do this.


      Dim FindFolder
      ' Global Variable 
      FindFolder = False
      ' *********************************************************************************************************************
      Sub FC
      While FindFolder = False
        Folder() 'Search for the folder
        If FindFolder = True Then 
          Exit Sub ' Folder was found so exit While loop
        End If
        PageDown() ' Folder was not found, so page down
      End Sub
      ' *********************************************************************************************************************
      Sub Folder()
      ' Searches for the folder
      Dim PropArray, ValuesArray, p, w
      ' Creates arrays of property names and values
      PropArray = Array("value", "ObjectIdentifier" ,"Visible")
      ValuesArray = Array("FOLDER NAME", "Name", True) ' FOLDER NAME is the name of the folder you are looking for
      Set p = Aliases.explorer.Items_View 'This is the mapped Explorer Window object containing the folder list
      Set w = p.FindChildEx(PropArray, ValuesArray, 10, True, 1000)
      If w.Exists Then
        w.DblClick ' Double Clicks on the desired folder to open it
        FindFolder = True   
      End IF 
      End Sub
      ' *********************************************************************************************************************
      Sub PageDown()
      ' Pages down the Explorer folder view
      Dim p
      Set p = Aliases.explorer.Items_View.Vertical_Scroll_Bar ' This is the mapped vertical scroll bar of the Explorer window
      End Sub 


    • m_essaid's avatar
      Valued Contributor

      Hi Alex,


      Thank you for your help,


      I think that that's don't apply, because I need to select a folder not a file.

      When I need to specify a file to open or to save I paste the unc path with the name. But here I have to browse and select a folder, a specific place...


      I really don't understand why 95% of my attempts are successfull and some, not always the same, fails. The typical "Additional info" is that I'm trying to click beyond the screen coordinates or to attempt to click on negative coordinates.

      But, as I already said when I redo the same test, same VM, another day it succeeds...


      Do I have problems with my network ? Disk access ?