Forum Discussion

ThiagoAraujo's avatar
ThiagoAraujo
Occasional Contributor
9 years ago

How to open a second pop up, without closing the first one?

Hello everybody,

 

I have a problem when trying to open and close a pop up in TestComplete.
I am currently writing regression script in C # language.

 

The problem: The system to which I test is web, and to access it you need to do the following steps: Open the browser to the login page, to make logging in, the system opens a pop up that becomes the system's main page - this is pop up in her full mode (maximized) ... I was able to test quietly as I worked on this main screen (pop up first).
But now I need to work on some pop up the system opens, ie is a pop up that opens a new pop up, this new pop up has a size less than 20% of the screen and is always centered (these pop are up to change password etc). The question is the following; to open the new pop up, TestComplete already open maximized way, and to try to close the new pop up, it actually closes the pop up the main system screen, or the screen is a layer below the new pop up.

I made a simple code to illustrate:

 

function OpenPassword()
{
      var Page;
      Page = Sys.Browser().ToUrl("mywebsite.com/changePassword");
      // DO SOMETHING
      Page.Close ();
}

 

arq.png

 

The code should open a new page, which is a pop up, and then I do some tests within the page and then shut.

 

The problem turns out; When the page opens, it opens and closes maximized the default page, which would be the first pop up.

My question is ... How can I map the pop up? as I can not open this second pop up, without closing the main pop up? I tried a number of ways, but so far not got no success with, for only opening the pop up, the system is closed...

 

I look forward suggestions. 

1 Reply

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi Thiago,

     

    Every site provides only one page at the moment (in terms of TestComplete and web browser). Popups, like provided on your screenshot, are usually implemented as child frames, divs, etc. of the main parent page.

    I would advice to either investigate the staructure of the page in the Object Browser of Test Complete or record your actions (by recording the script code, but not keyword test) and examine recorded code.