Forum Discussion

nassim's avatar
nassim
Occasional Contributor
14 years ago

Closing special browser windows

Hi. I have opened three windows of Mozilla Firefox browser and have browsed in each f them. In my test, it is required that I close the third and second window. I tried to record it but durig playback, the first and second windows are closed.I would be grateful if someone helps.

5 Replies

  • karkadil's avatar
    karkadil
    Valued Contributor
    To address 2nd and 3rd processes, use the following format of the Process() method:

    Sys.Process(name, 2)

    Sys.Process(name, 3)



    For example, the following code will terminate the 3rd firefox process



    Sys.Process("firefox", 3).Terminate
  • nassim's avatar
    nassim
    Occasional Contributor
    Hi. I tried your solution using Sys.Process("firefox", 3).Terminate 
    and Sys.Process("firefox", 2).Terminate. No window will get closed. In the log I get the errors: "Process not found" with the remark "Name=firefox,Index=3"

     and

     "The object does not exist. " with the remark "You are trying to call the Terminate method or property of the Process("firefox", 3) object that does not exist.

    Best regards
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi, Nassim.


    This is an issue related to playing back the test for the Mozilla Firefox browser. I've registered it in our DB. Thanks for reporting it.


    I have one suggestion: try to record all the actions you need by using the Internet Explorer browser and then change the name of the used process from iexplore to firefox. Does this help?

  • nassim's avatar
    nassim
    Occasional Contributor
    Hi,

    Looking at Object Browser, I tried

    Sys.Process("firefox").Window("MozillaUIWindowClass", "windowCaption", 1).Close

    It functions correctly and solves my problem.

    Thanks for your help.
  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Nassim,


    Our developers are investigating the problem you described in your first post. They ask whether they can obtain the recorded script code (that didn't work).


    So, it would be very helpful for us, if you:

    1. Posted that recorded code here. If you don't want to share it on the forum, please send the code to our Support Team.

    2. Told us the exact version of the Mozilla Firefox browser you are using.


    Thanks a lot.