Forum Discussion

sriram_sig's avatar
sriram_sig
Contributor
6 years ago
Solved

How to perform action on a new tab opened during test run

I have a testcase wherein by clicking on a link, a new tab is opened and have to fill a form on this new tab i'm openign a new browser using the below code Sys.Browser("chrome").BrowserWindow(0)....
  • tristaanogre's avatar
    6 years ago

    You mention that Page1 and Page2 are from NameMapping... but I don't see any NameMapping references in your code.  I would expect to see Aliases.browser.page1 for a reference via NameMapping.  

     

    In any case... here's my thinking.  There is a click action that opens another tab and renders page2. I'm assuming, though, that there is a delay in that rendering.  The code you have below has no code to "wait" for the page to complete loading before you interact with it.  The "Venu" object you're trying to find MAY be present, but if the page hasn't fully rendered yet, it may not have dimensions making it clickable.

    After each navigation to a page, you should call the "Wait" method on that page.  That will wait for the page to render.  THEN you can perform your actions against it.