Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP consuming more time while checking for the objects
#1
Hi All,

In my script as the precondition we check for some objects in application, the pseudo code is like this:
Code:
Set objBrowser = Browser("x").Page("y") With objBrowser If .[b]webelement("z").Exist [/b]Then msgbox "Pass" else msgbox "Fail" end if End With

If condition is taking some around 8-10 seconds, which is not expected and unusual. After this condition, the rest of the script executes fast. It happens almost in every script which is affecting the performance of execution. I am not able to find any clue why its taking so much of time just for checking the webelement as the first step in script.

Can anyone please help me out here.

Thanks in adv,
Sravanthi
Reply
#2
can you tell ,if teh webelement you are checking is present in the screeen or not .with these kind of statements ,generally i feel if it doesnot get that element immediatly , it waits certain time and then proceeds to next step.

put a sync point before teh if statement this will remove any chances of
page loading delay of that statement.
Reply
#3
Hi Sravanthi,
Plz use as given below.
Browser().Page().Webelement().Exist(1) ' it will wait for a sec and return true or false based on the objects availability.
Reply
#4
Hi Sailaja,

Thanks for the reply. The webelement exists in appln when the test case executes if condition. Yes I will check by using .sync before condition.

Thanks,
Sravanthi

@ vIns

Thanks for the reply. I will use .Exist(1) and check the performance. But as the required object exists in appln, i assume that qtp should not consume more time to identify. Will update you after modfiication.

Thanks,
Sravanthi
Reply
#5
Hi,

I have used both .Sync and .Exist(1) approaches. But no siginificant improvement in performance. Anyone please help.

THanks,
Sravanthi
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Checking text msg dynamically... Shandru 1 2,651 10-06-2010, 12:08 PM
Last Post: Saket
  Time Out in QTP at the time of Execution jakkasureshkumar 1 3,999 12-24-2008, 10:43 PM
Last Post: Ankur
  Database Checking Rajesh 1 3,297 01-16-2008, 11:41 AM
Last Post: Ankur

Forum Jump:


Users browsing this thread: 1 Guest(s)