Forum Discussion

MarcusBengtsson's avatar
MarcusBengtsson
Frequent Contributor
2 years ago

Browserwindow 2 not clickable

Hello! I have a problem interacting with a popup window, tried to set focus etc but test complete does not identify the window as browser 2, so when ever I record click on that window it tries to click on the "base" window browser 1.

 

I marked the image below:

1 - The web page

2 - The edit window (this works without any issue)

3 - This is the browserwindow2 I try to click inside, whenever I record it doesn't see this as a new window and still trying to click on the web page (1).

 

Is there any good solution on how to get it to identify that a new popup have been opened up and it should work with that window instead?

I tried some namemapping changes, set focus etc but so far no good 😞

 

 

20 Replies

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Hello Rraghvani! I tried the setup but not able to get it to work.. 

       

      I do not have multiple browsers open (might have in that case but not when testing atm).

      I tried to check the object browser but it just keeps saying it is browser window in properties.

       

       

      The object spy does not recognize it as "window2" or so to say.

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I have two Chrome browsers opened, and the URL's are the same.

     

    I can distinguish between the two browsers using the property Name.

    You will need to modify your MappedName.

     

    Also, it's worth expanding 'View more members (Advanced view)'.

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Appreciate the help! Yes I know its namemapping error trying to check and see what could be the issue.. Changed to advancedview.

       

      Main window - 

      Popup window -

       

      I changed in namemapping and dragged the items to Browserwindow2 but no success 😞

      Namemapping -

       

      After changing namemapping I did a object spy to check, it is now "blinking" on the Fuel but when I run  the test it cant find it again.. getting so confused for something so simple haha..

       

       

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    What are the properties of these three mapped objects?

     

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      First of all, thanks a lot for the help you are giving! πŸ™‚

       

      Here are the properties.

       

       

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I suggest you create a new project and use the Object Spy tool to identify your three windows. Use the Page property and not BrowserWindow, and create a structure like this,

    Once you've created your mapped objects, use the Highlight tool to see if it can highlight the correct page.

     

    Also, change your project settings of Tree Model to be "Tree"

     

    This is just to test if you can distinguish between the three pages. Once the Highlight, highlights the correct page. You can then apply these "changes" to your actual project.

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Thanks! So I did new namemapping now to see if it can distinguish between them and it seems like it.

       

      BrowserWindow1 (masterpage?)

       

      Child window (BrowserWindow2)

       

      Child window 2 (BrowserWindow3) this window is opened up from BrowserWindow2.

       

      I noticed something when doing the new namemapping.. If the parent window is infront of the child window, it is not possible to "target" the child window entierly.. it will still find the objects behind it like this ->

       

       

      Also a question I have if I get this to work, lets say I want to record for the browserwindow3, I make some steps and then when the recording is done it will put it as BrowserWindow1, is it the "correct" way to rename the "BrowserWindow1" Aliases as shown in image below to "BrowserWindow3" so that all aliases for the steps below gets changed as well or is there a better way for this?

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Doesn't look like you've created a new project!?

     

    Highlight will only highlight the UI Object. It won't bring it into focus.

     

    The UI Objects should be mapped to their correct pages. You can drag and drop Mapped Objects into Aliases to build up a tree structure. If you change the ordering of items, then problems will occur. 

     

    It's best to use names such as "ComTest", "Template" and "CrossReference" as opposed to "BrowserWindow".

     

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Haha no I did a new project and got the same result and then did the same steps in my current project, sorry! πŸ˜„ Okey will do

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      This is how the error looks when I try to run the test now. I dont understand how hard it can be to make it click on ModifyCrossReference window now 😞 

       

       

       

       

       

      As my recording of the steps will be put in the "ComTestWebUtilities".. Can i copy these over to ModifyCrossReference? or how do i create namemapping for the click functions for modifycrossref? 

       

       

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    The reason for creating a new project, was not to use any existing name mappings which may interfere with identifying the three windows you're having issues with.

     

    You need to ensure that your Object Identification is correct before proceeding.

     

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Making new project again to show you, however when I try to select each window with the object spy it is shown like this, do you know why? I cannot select the whole modify cross reference window when the window behind is up. 

       

       

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Okey so I created a new project, did a click on each page starting from

       

      Main page -> ECU page -> Modify Cross reference page and then lastly right click on it.

       

      Did 0 recording only added "on screen action" and this is how it looks in the keyword test now. 

      And it works, it actually right clicks the modify cross reference now, how would I proceed to clean up in the project where I have my tests? Sounds like the record and play will cause a lot of issues for popup windows 😞

      • MarcusBengtsson's avatar
        MarcusBengtsson
        Frequent Contributor

        I tried to get the same result on the "main" project but when trying to namemap there it will not go to the same as in the new project, it will not create aliases, it will use sys.browser etc which is completely wrong. Is my only option to delete all the namemapping and redo everything to get it to work..?

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I always use the Object Spy tool to build my mapped objects, ensuring that TC is able to identify each UI Objects. If TC is having issues identifying an object that I had just mapped, I'll add another property. That way, TC will know exactly what UI Object I'm referring to. From there one, I'll build my Aliases

     

    Keyword testing should work without issues if you have correctly mapped objects and aliases.

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor

      Yeah I think I will need to redo most of my things, start over and make namemapping a big priority in order for it to run good.. 

    • MarcusBengtsson's avatar
      MarcusBengtsson
      Frequent Contributor
      Will do, thanks for all the support! Also would you recommend not renaming namemapping (top row) and only to rename Aliases?
  • rraghvani's avatar
    rraghvani
    Champion Level 3

    I only rename the UI objects I'm interacting with. For example, if the object tree browser looks like this

    NameMapping.Sys.browser.pageTestcomplete.form.panelAutomatedUiTestingThatCover.sectionAutomatedUiTestingThatCov.panelAutomatedUiTestingThatCover.panelAutomatedUiTestingThatCover.panelAutomatedUiTestingThatCover.panelAutomatedUiTestingThatCover.panelAutomatedUiTestingThatCover.linkTryTestcompleteNow, I'll map the object names as default, but will only change the name of linkTryTestcompleteNow to something suitable. My aliases tree structure will then look like this pageTestcomplete.linkTryTestcompleteNow. I keep the mapped name and aliases name the same. 

     

    I use the "tree structure" model, because the web app I'm testing was never intended to be automated. Hence, majority of the UI controls don't have ID's