Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
After running about 70-80 transactions QTP and the browser hangs and stops running.
#3
Not Solved
Code:
' First opening the IE browser and do some work in Admin page
        IE = CreateObject("InternetExplorer.Application")
        IE.Visible = True
        IE.Navigate(DataTable("URL", dtGlobalSheet) & "Administration/")

        Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Set(DataTable("NTUserName", dtGlobalSheet))
        Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Type(micTab)
        Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Set(DataTable("NTPassword", dtGlobalSheet))
        Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Type(micTab)
        Browser("Browser_3").Dialog("Connect to Website").WinCheckBox("Remember my password").Set(DataTable("RememberNTPassword", dtGlobalSheet))
        Browser("Browser_3").Dialog("Connect to Website").WinButton("OK").Click()
        Browser("Administration").Page("Administration_Index").WebList("ctl00$Child1$FIRST_NAME").Select(DataTable("AdminFirstName", dtGlobalSheet))
        Browser("Administration").Page("Administration_Index").WebList("ctl00$Child1$LAST_NAME").Select(DataTable("AdminLastName", dtGlobalSheet))
        Browser("Administration").Page("Administration_Index").WebEdit("ctl00$Child1$PASSWORD").Set(DataTable("AdminPassword", dtGlobalSheet))
        Browser("Administration").Page("Administration_Index").WebButton("Login").Click()
        Browser("Administration").Page("Administration_Index_01").Link("Add UserTest Folder/Group").Click()
        Browser("Administration").Page("Administration_AddUserTest").WebButton("Add UserTest Folder\Group").Click()
        Browser("Administration").Page("Administration_AddUserTest_02").WebButton("Add DocumentRepository").Click()
        Browser("Administration").Page("Administration_AddUserTest_03").WebButton("Create Product Folders").Click()
        Browser("Administration").Page("Administration_Index_03").Sync()

        'After doing this work closing the IE browser.
        SystemUtil.CloseProcessByName("IEXPLORE.EXE")
        IE = Nothing

        ' Here i am applying the two loops , 1st is for number of members within database, 2nd is for number of groups within database.
        ' that means each and every user iterate with each and every group within database.
        ' there are total 60 users and 60 groups in the datase, means this sript will open the browser 60*60 times.
        ' but currently this will iterate for only 4 users , that means 4*60=240 . after this browser hangs and we could not run the script agian
        'So to run for remaning user , i have to delete first 4 users from database and  again i have to open the script and run it.

        For Member_row_number = 1 To Number_of_Members

            sQuery2 = "select WG_NAME from WorkgroupMembers where (FIRST_NAME= '" & Member.Item("FIRST_NAME" & Member_row_number) & "' AND LAST_NAME = '" &         Member.Item("LAST_NAME" & Member_row_number) & "' AND UPDATE_STATUS = 'Subscribed') "
            SubscribedWorkGroup = CreateObject("Scripting.Dictionary")
            Number_of_SubscribedWorkGroup = GetData(sQuery2, SubscribedWorkGroup)

            For row_number = 1 To Number_of_Groups
                strSubscribed = False

                For SubscribedWorkGrouprow_number = 1 To Number_of_SubscribedWorkGroup
                    If WorkGroup.Item("WG_NAME" & row_number) = SubscribedWorkGroup.Item("WG_NAME" & SubscribedWorkGrouprow_number) Then
                        strSubscribed = True
                        Exit For
                    End If
                Next
                ' Agian open the browser and check for user rights using page.
                IE = CreateObject("InternetExplorer.Application")
                IE.Visible = True
                IE.Navigate(DataTable("URL", dtGlobalSheet) & "Documents/" & WorkGroup.Item("WG_NAME" & row_number) & "/Test.txt")

                Browser("Browser_3").Dialog("Connect to Website").Activate()
                Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Set(DataTable("Domain", dtGlobalSheet) & "\" &         Member.Item("FIRST_NAME" & Member_row_number) & "." & Member.Item("LAST_NAME" & Member_row_number))
                Browser("Browser_3").Dialog("Connect to Website").WinEdit("User name:").Type(micTab)
                Browser("Browser_3").Dialog("Connect to Website").WinEdit("Password:").Set(Member.Item("USER_PASSWORD" & Member_row_number))
                Browser("Browser_3").Dialog("Connect to Website").WinCheckBox("Remember my password").Set("ON")
                Browser("Browser_3").Dialog("Connect to Website").WinButton("OK").Click()

                'Doing something
                ''''''''
                ''''''''
                ''''''''
                'Writing into report depending upoun the doing something

                'Close browser.
                SystemUtil.CloseProcessByName("IEXPLORE.EXE")
                IE = Nothing

                Webutil.DeleteCookies()
            Next
            SubscribedWorkGroup = Nothing
        Next
[attachment=136][attachment=136][attachment=136]
.txt   Script.txt (Size: 5.04 KB / Downloads: 101)
Reply


Messages In This Thread
RE: After running about 70-80 transactions QTP and the browser hangs and stops runnin - by pram - 12-04-2008, 01:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to avoid system lock while running Windows Based Application SaranKumarV 6 21,665 03-21-2018, 04:18 PM
Last Post: blr.moin@gmail.com
  Scripts stops after performing a step when it has been initiated by schedule task. Ajit.2k6 9 5,875 02-16-2016, 08:37 PM
Last Post: lakshman.us
  Running UFT scripts on a remote machine with no UFT installed on the Remote machine anupam4j 0 3,037 01-21-2016, 06:48 PM
Last Post: anupam4j
  Running QTP scripts without QC sowjanya 3 6,118 07-16-2015, 11:16 AM
Last Post: ravi.gajul
  Fireevent ondblclick hangs QTP until window is closed Andor 2 1,860 06-01-2015, 08:10 PM
Last Post: Andor

Forum Jump:


Users browsing this thread: 3 Guest(s)