Micro Focus QTP (UFT) Forums
After running about 70-80 transactions QTP and the browser hangs and stops running. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: After running about 70-80 transactions QTP and the browser hangs and stops running. (/Thread-After-running-about-70-80-transactions-QTP-and-the-browser-hangs-and-stops-running)

Pages: 1 2


After running about 70-80 transactions QTP and the browser hangs and stops running. - pram - 12-04-2008

In my script i am reading the data from the database. for each database row i am opening the browser, doing some work , and again closing the browser. After running about 70-80 transactions QTP and the browser hangs and stops running.
Please tell me why this is happening. i search a lot on web but didn't find any solution, Is there is any setting in qtp? or any other setting ?


RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - Ankur - 12-04-2008

Would like to see your code. Please use proper formatting while posting it.


RE: After running about 70-80 transactions QTP and the browser hangs and stops runnin - pram - 12-04-2008

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][attachment=137]


RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - pram - 12-04-2008

Due to some reason i can't format the script from your site so i attached the script as script.txt


RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - Ankur - 12-04-2008

The code needs to be optimized. Can you check the RAM usage before, during and after the browser hangs.

by the way, what is the problem you are facing formatting code on this site?


RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - pram - 12-04-2008

To post the script in your site i formatted the script in VS and paste it here , after viewing the Preview Post i can't see the same formatted script in your site.


RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - pram - 12-04-2008

Hello Ankur,
As per your suggestion i checked Ram of the machine on which i am running this test.
Staus of RAM as following

Before Running the test
-----------------------
Physical Memory(k)
Total 775280
Available 427988
System Cache 407436



During Running the test
-----------------------
Physical Memory(k)
Total 775280
Available 337668
System Cache 352344


After Running the test ( when browser hangs)
--------------------------------------------
Physical Memory(k)
Total 775280
Available 307360
System Cache 353588


so i think seeing this i was not problem of memory ( still available memory is there )
what other factor cause this problem?
your help will be appreciated.


RE:After running about 70-80transactions QTP and the browser hangs and stops running. - Pipo - 04-15-2009

The below statements order does not look ok
It may be the problem

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



RE: After running about 70-80 transactions QTP and the browser hangs and stops running. - george123 - 08-27-2009

Hi - I was wondering if an answer has been found to the posted problem. I have a very similar problem. I am processing records in a web based '.net' application.

My script reads a customer ID from a spreadsheet and then uses the customer ID to process the customer record in the application. Many times (although not always), QTP will literally hang after approx. 80 records. I have to kill the QTP process in the task manager.

I am using QTP 9.2.

Please let me know if you have found a solution or have any new ieas.

Thanks,
George


RE: After running about 70-80 transactions QTP and the browser hangs and stops runnin - basanth27 - 08-27-2009

George -

Several Reasons pile up when QTP hangs. There are multiple dependencies due to which there is a crash or the tool simply moves to a non-responding state.

1 . Data Issue : -
1. Why does it hang after 80th record only ??
2. what does the 79th or 80th or 81st record contain ?? Is there something which is different from the other records ?

2. System Issue -
1. What is the RAM Usage during the whole process ??
2. At the point when it hangs what is the CPU usage ??
3. What else process consumes the max ram when QTP Hangs ?

3. IE issue -
1. How much of a client Side validation does the application depend on ??
2. Does it download all the controls everytime you open IE ??
3. What is the Max size defined for storing Temporary internet files for IE ??

Lastly, Please paste your formatted code for us to understand what exactly is the issue and to help you tweak the optimization factor.

I guess you must have had some solutions so far, My 2 cents would be,

1. what is the reason you are creating a IE object ?? Wouldnt ,
Code:
systemUtil.Run "Iexplorer.exe", urlpath
Work ?

2. Can you put up a counter and find exactly at which record does it hang up ?

3. You mentioned the RAM status. I am also intrested to know which process would consume the max RAM during the Hang-up Process ? Is it QTP or the IE ?

4. IE browser Version and QTP version ?

Let me know and i will help you to my best.
Sorry for the typo,

It should be SystemUtil.Run "Iexplore.exe",urlpath instead of ,
SystemUtil.Run "Iexplorer.exe", urlpath.