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.
#1
Not Solved
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 ?
Reply
#2
Not Solved
Would like to see your code. Please use proper formatting while posting it.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#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
#4
Not Solved
Due to some reason i can't format the script from your site so i attached the script as script.txt
Reply
#5
Not Solved
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?
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply
#6
Not Solved
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.
Reply
#7
Not Solved
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.
Reply
#8
Not Solved
The below statements order does not look ok
It may be the problem

Code:
'Close browser.
SystemUtil.CloseProcessByName("IEXPLORE.EXE")
IE = Nothing
Reply
#9
Not Solved
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
Reply
#10
Not Solved
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to avoid system lock while running Windows Based Application SaranKumarV 6 21,671 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,920 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,041 01-21-2016, 06:48 PM
Last Post: anupam4j
  Running QTP scripts without QC sowjanya 3 6,131 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: 2 Guest(s)