Posts: 91
Threads: 19
Joined: May 2011
Reputation:
0
12-21-2011, 05:54 PM
(This post was last modified: 12-21-2011, 06:25 PM by Sathiya.)
hi Dude,
thanks for the valuable information.
In our application usually we use the following comment for waittime
Wait(10)
from your trick i use the following code
sVal=Setting.(“DefaultLoadTime”)
but the sVal was always "20"
actually i want to retrive the time taken for page loading(during various actions)
please help me in this regard.
thanks in advance
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
01-30-2012, 07:51 PM
(This post was last modified: 01-30-2012, 07:59 PM by rajpes.)
(12-21-2011, 05:54 PM)Sathiya Wrote: hi Dude,
thanks for the valuable information.
In our application usually we use the following comment for waittime
Wait(10)
from your trick i use the following code
sVal=Setting.(“DefaultLoadTime”)
but the sVal was always "20"
actually i want to retrive the time taken for page loading(during various actions)
please help me in this regard.
thanks in advance As i have indicated earlier, the setting changes are not saved once you close/exit qtp.You can use "timer" trick to find no. of seconds a page is taking to load.
Assume your page has an image which is rendered after page is completely loaded.
Dim startTimer,endTimer
startTimer=Timer
while NOT B().P().Image().exist(1)
wend
endTimer=Timer
msgbox "total time taken in seconds:"& endTimer-startTimer
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
@Sankalp,The values will be stored somewhere internally, you dont have to worry about that.Just make use of the values anytime even after test run is over!
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
02-06-2012, 07:45 PM
(This post was last modified: 02-06-2012, 07:50 PM by rajpes.)
This is another cool tip i discovered today.
Suppose you have few webedits on a page and you need to add all of them into a shared object repository,instead of adding individual objects, go to object repository manager>press F6. click on Filter icon,configure only webedits.
Then click on "Learn".
Now all webeidts on the page would appear in the repository.
You can choose mixture of object types as well (eg:webedits and links).
This will save your time if you needed to add lots of objects
Posts: 1
Threads: 0
Joined: Feb 2012
Reputation:
0
This one is really cool...i'll definetly try it. Thanks
Posts: 64
Threads: 7
Joined: Aug 2008
Reputation:
0
(02-06-2012, 07:45 PM)rajpes Wrote: This is another cool tip i discovered today.
Suppose you have few webedits on a page and you need to add all of them into a shared object repository,instead of adding individual objects, go to object repository manager>press F6. click on Filter icon,configure only webedits.
Then click on "Learn".
Now all webeidts on the page would appear in the repository.
You can choose mixture of object types as well (eg:webedits and links).
This will save your time if you needed to add lots of objects
Rajpes,
Good short cut to save the time adding the objects into OR.
Is any way add objects like that into existing OR.?
Posts: 60
Threads: 0
Joined: Feb 2012
Reputation:
0
(02-16-2012, 10:28 AM)MVChowdary Wrote: (02-06-2012, 07:45 PM)rajpes Wrote: This is another cool tip i discovered today.
Suppose you have few webedits on a page and you need to add all of them into a shared object repository,instead of adding individual objects, go to object repository manager>press F6. click on Filter icon,configure only webedits.
Then click on "Learn".
Now all webeidts on the page would appear in the repository.
You can choose mixture of object types as well (eg:webedits and links).
This will save your time if you needed to add lots of objects
Rajpes,
Good short cut to save the time adding the objects into OR.
Is any way add objects like that into existing OR.?
AddObject method of Mercury.objectrepositoryUtil will be helpful for this. explore it further.
Posts: 275
Threads: 4
Joined: Jul 2011
Reputation:
0
03-02-2012, 01:42 PM
(This post was last modified: 03-02-2012, 01:43 PM by rajpes.)
(02-16-2012, 10:28 AM)MVChowdary Wrote: (02-06-2012, 07:45 PM)rajpes Wrote: Suppose you have few webedits on a page and you need to add all of them into a shared object repository,instead of adding individual objects, go to object repository manager>press F6. click on Filter icon,configure only webedits.
Then click on "Learn".
Now all webeidts on the page would appear in the repository.
You can choose mixture of object types as well (eg:webedits and links).
This will save your time if you needed to add lots of objects
Rajpes,
Good short cut to save the time adding the objects into OR.
Is any way add objects like that into existing OR.?
You can first export local objects into a shared object repository(.tsr) Then open it in OR manager then add required objects of same type,save it.Delete all objects in your local OR and finally attach this SOR.
Posts: 426
Threads: 4
Joined: Aug 2011
Reputation:
0
(02-02-2012, 04:59 PM)rajpes Wrote: @Sankalp,The values will be stored somewhere internally, you dont have to worry about that.Just make use of the values anytime even after test run is over!
Hi,
Thanks, 4 ur Reply.
One more query. If I have 2 scripts say A and B, I used settings.Add() in script A and try to use those value in Script B, will it be possible???
Regards,
Sankalp
Posts: 2
Threads: 0
Joined: Apr 2012
Reputation:
0
03-07-2014, 04:05 AM
(This post was last modified: 03-07-2014, 04:16 AM by nakulgupta18.)
(07-27-2011, 04:05 PM)rajpes Wrote: Just a puzzle here,You need print the pattern like below depending on no. of rows
rows=3,
**1**
*212*
32123
rows=4,
***1***
**212**
*32123*
4321234
Code: r=inputbox ("enter no of rows")
c=(2*r)-1
m=(c-1)/2
ReDim a(r-1,c-1)
For i=0 to r-1
For j=0 to c-1
a(i,j)="*"
Next
Next
'mid of all rows
For i=0 to r-1
a(i,r-1)=1
Next
'rows manipulation
For i=1 to r-1
For j=0 to m-1
'If previous row has a value at next column position,increment it by 1
If a(i-1,j+1)<>"*" Then
val=a(i-1,j+1)+2 '2 instead of 1 because i am decrementing 'val' by 1 in next line
For k=j to m-1
val=val-1
a(i,k)=val
a(i,c-1-k)=val
Next
End If
Next
Next
'print
For i=0 to r-1
For j=0 to c-1
txt= txt& a(i,j)
Next
txt=txt&vblf
Next
msgbox txt
If you have a better tested code, please post it
Hi Rajpes,
Here you go -
Code: row = inputbox(" enter no. of rows")
r = row
c = row*2- 1
ReDim a(r,c)
For i = 0 to r-1
For j = 0 to c-1
a(i, j) = abs(r -j-1) + 1
If a(i, j ) > i+1 Then
a(i, j) = "*"
End If
txt= txt& a(i,j)
Next
txt=txt&vblf
Next
msgbox txt
If you have better code than this then please post
|