SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    Member
    Join Date
    Jan 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to close all browsers, QTP&QualityCenter

    Hi
    I have some testcase in a testsuit in quality center. I want to close all the applications(all are IE borwsers), Quality center after disconnecting from QTP and then clsoing QTP. [this sequence does not matter]. I have a script which do this but i dont know from where to call it. If i place the script after the testsuit, then after dicsonnecting QC and QTP, script stops executing and QC,QTP remains on the desktop.

    Please help
    Here is the code i am using

    <font class="small">Code:</font><hr /><pre> Dim qtApp
    Set qtApp = CreateObject("QuickTest.Application")
    if qtApp.TDConnection.Isconnected then
    qtApp.TDConnection.Disconnect
    end if
    qtApp.Quit
    Set qtApp = Nothing
    Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")
    Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'iexplore.exe'")
    For Each objProcess in colProcess
    objProcess.Terminate()
    Next
    Set objWMIService = Nothing
    Set colProcess = Nothing
    </pre><hr />

  2. #2
    Junior Member
    Join Date
    Jan 2008
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    flag=0
    while (flag=0)
    If (Browser("name:=.*").exist) Then
    msgbox "Hello"
    Browser("name:=.*").Close
    else
    flag=5
    End If
    wend

  3. #3
    Member
    Join Date
    Jan 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    I have the code ready to close all the browsers, QTP and QC also....my problem is from where to call it. The code i have given with the my question
    The following code is running condition if i placed it outside QTP and double click it.

    Again for your reference i am providing the code to you
    Dim qtApp
    Set qtApp = CreateObject("QuickTest.Application")
    if qtApp.TDConnection.Isconnected then qtApp.TDConnection.Disconnect
    end if
    qtApp.Quit
    Set qtApp = Nothing
    Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name = 'iexplore.exe'")
    For Each objProcess in colProcess
    objProcess.Terminate()
    Next
    Set objWMIService = Nothing
    Set colProcess = Nothing

  4. #4
    Senior Member
    Join Date
    Mar 2006
    Location
    Bristol, UK
    Posts
    1,530
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    Is this code running within a QTP script? You're using the AOM which would normally be used outside of QTP.

  5. #5
    Member
    Join Date
    Jan 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    No this code is not running within a QTP script. It is running fine if it is placed outside QTP and double clicked

    Please help me how to solve my problem...

  6. #6
    Member
    Join Date
    Jan 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    Reframing my question:
    I am running a test suit in QTP through QC. At the end of suit run
    Item 1. I want to disconnect QC from QTP
    Item 2. Wanted to close QTP
    Item 3. Wanted to close QC window\browser.

    Sequence of Items does not matter .

    Code to Disconnect QC and QTP
    Dim qtApp
    Set qtApp = CreateObject("QuickTest.Application")
    if qtApp.TDConnection.Isconnected then qtApp.TDConnection.Disconnect
    end if

    Code to close QTP
    qtApp.Quit

    I tried following
    1. I place the script as the last script of the suit and in script i coded like item 1 then item 2 then item 3 then after dicsonnecting QC and QTP, script stops executing and QC,QTP remains on the desktop.

    2.1. I place the script as the last script of the suit and in script i coded like item 2 then item 1 then item 3 then QTP closes so the code belong to item 1 and item 3 does not executed at all.

    Please guide me I am going in correct direction or is there any other way.

  7. #7
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    Not sure you want to close the QC browser, as QC has some work to do after the testset completes; and after each test completes in the testset.

    So while you could place your "nuke all browsers" code in a QTP test script and execute it as the last script in a QC testset I think you would get unpredictable results in QC.

    Why are you intent on closing the QC browser?

  8. #8
    Moderator
    Join Date
    Sep 2001
    Location
    Yankee Land
    Posts
    4,055
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    Would it be possible to do something like this when QTP starts up?

    Its something I have asked our QTP script writer about, the concept is to close any existing IE browsers on a machine when the test scripts start so QTP can then start its own browser and continue.

    - M
    - M

    Nothing learns better than experience.

    "So as I struggle with this issue I am confronted with the reality that noting is perfect."
    - Unknown

    Now wasting blog space at QAForums Blogs - The Lookout

  9. #9
    SQA Knight
    Join Date
    Jul 1999
    Location
    Grand Rapids, MI
    Posts
    3,727
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    [ QUOTE ]
    Would it be possible to do something like this when QTP starts up?


    [/ QUOTE ]
    This is what I do, rather than closing all non-QC browsers at the end of a test. I do this so that if a test fails (especially when I am running it standalone under QTP, or as the only test in a QC testset) that I will be able to inspect the browser when the test bailed out.

    At any rate attached is a general purpose QTP function I wrote that will close all browsers found on the desktop, EXCEPT the QC browser. This function could be modified to remove the "except the QC browser" code, which would then nuke all open browsers, including the QC browser (but again, I don't think you want to do that).
    Attached Files Attached Files

  10. #10
    Member
    Join Date
    Jan 2007
    Posts
    36
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to close all browsers, QTP&QualityCenter

    Hi Frnds,

    My mian concern is to run the script of "Clsoing QC and QTP" from QC itself. I can close the borwsers including \ excluding QC through script.

    Please help me for this issue.

 

 
Page 1 of 2 12 LastLast

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 9.68%
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 01:49 PM.

Copyright BetaSoft Inc.