SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    QTP close/start firefox

    Hi All,

    I install QTP 10, Win Xp, FF 3.6.

    Need to use QTP start/close firefox to do multiple iteration run. (say need to start -> do something -> close browser, run 5 times)

    Wonder any proper way to start / close browser?

    Regards,

  2. #2
    Member
    Join Date
    Feb 2009
    Posts
    80
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP close/start firefox

    For i = 1to 5
    SystemUtil.Run "firefox"
    Window("Mozilla Firefox").Activate
    Window("Mozilla Firefox").Close
    Msgbox "Browser Closed is = " & i
    Wait(2)
    Next

  3. #3
    Junior Member
    Join Date
    Sep 2011
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP close/start firefox

    [ QUOTE ]
    For i = 1to 5
    SystemUtil.Run "firefox"
    Window("Mozilla Firefox").Activate
    Window("Mozilla Firefox").Close
    Msgbox "Browser Closed is = " & i
    Wait(2)
    Next

    [/ QUOTE ]


    Why use Window("Mozilla Firefox").Activate ?

    I met a error here. <font color="red"> </font>

  4. #4
    Member
    Join Date
    Aug 2008
    Posts
    150
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP close/start firefox

    Do you have Window("Mozilla Firefox") defined in your OR?

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    11
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: QTP close/start firefox

    [ QUOTE ]
    Do you have Window("Mozilla Firefox") defined in your OR?

    [/ QUOTE ]

    hi I used this function to close browsers:

    '---------------------------------------------
    ' Close all browsers
    '---------------------------------------------
    Public Sub CloseAllBrowsers()
    Dim Process, ProcessList
    Set ProcessList = GetObject("winmgmts://.").InstancesOf("win32_process")
    For Each Process In ProcessList
    If instr (ucase(Process.Name), ucase(g_Browser)) &lt;&gt; 0 Then
    Process.Terminate
    End If
    Next
    End Sub

    =================

    Kill process of "firefox.exe"

    The side effect is, when i reopen another new browser, the previous one sit in the first Tab page, Which I don't expect to have it.

    Don't know how to resolve it ?

    Any idea ?? [img]/images/graemlins/confused.gif[/img]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 04:11 PM.

Copyright BetaSoft Inc.