Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
5 years ago

Search webelement on browser another window

Search webelement on browser another window, I am working on a scenario where after click on a link ..it's open in browser another window where i need to identify web elements
I get that window address by using Aliases.browser.BrowserWindow
but I'm  not able to find web element on that another window page where i need to perform click event.

how can i do the same please guide me.

  • Hi,

     

    I open a link that open in browser another window

    Every web element in TestComplete is a descendant of a page object that corresponds to web page opened in a browser. So the generic syntax is

    Browser.page.FindChild(...)

    The above means that you must identify the new web page that is opened after clicking the link (use Object Browser for that) and use this page as a root for the search of the elements that your test code needs to interact with on it.

     

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Aliases.browser.BrowserWindow

    I am not sure how BrowserWindow is namemapped, but as long as you identify correct web page (not browser window) you should be able to find the required web element with no problem.

     

    • kaiiii's avatar
      kaiiii
      Regular Contributor

      Hi AlexKaras 

      I am not sure how Browser Window is name mapped,

      For my query, I tried to use record mechanism and then convert it into script then I found in my name mapping browser window is displaying under browser tree. when I wndcaption value for same it was for that exact second windows wndcaption details there.

      But I'm not able to find out page on that browser window that's why I am not able to identify webelemnt.

      Condition Describe again: I open a link that open in browser another window(paypal payment open in another window)>> so on that new browser window I need to enter login credentials for same .. but I'm not finding any solution with my script

      Hi, let's forget this

      Aliases.browser.BrowserWindow but if you want handle situation like this , I would you handle this. Please guide me

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        I open a link that open in browser another window

        Every web element in TestComplete is a descendant of a page object that corresponds to web page opened in a browser. So the generic syntax is

        Browser.page.FindChild(...)

        The above means that you must identify the new web page that is opened after clicking the link (use Object Browser for that) and use this page as a root for the search of the elements that your test code needs to interact with on it.