waiting for a web page to return

Hints and tricks for using Mouse and Key Recorder

waiting for a web page to return

Postby ukmdb » 26 Feb 2010, 17:10

Hi Kra-Tronic.

I have been tasked to checkout ways we can simulate a user accessing a web system and timing how long it takes.
I have come accross your application and while testing so far it looks like it could be fit for our purpose.

Please could you explain how the following scinario would be possible. and give an example so then we can change it for our needs.
I presume the waitforIEReady command will be used but unsure how this is used.
I do not want to send a wait command for say 10 seconds when the page could be loaded in 2 seconds.
The whole idea is so we can automate a search and time how long it took from start to finish.

1. Open IE and navigate to www.ukmdb.co.uk
2. wait for the page to load which can be anything from 2-5 seconds
3. When the page loads "enter elvis presley" in search field and click search
4. wait for the results to populate.
5. click on the "details" link at the side of the song "return to sender"
6. wait for page to load.
7. close all IE windows

The time taken would be recorded in the log file.

Hope you can help and this product is what we are looking for.
ukmdb
 
Posts: 1
Joined: 26 Feb 2010, 13:26

Re: waiting for a web page to return

Postby admin » 28 Feb 2010, 11:35

Here an example:

{{SetStringArtist elvis presley
{{SetStringSong Return to sender
{{SetVarTime {{SerialTime}
{{WindowsAeroOff}
{{WindowsKey R
www.ukmdb.co.uk
{ENTER}
{{Delay 500} {{' Milliseconds
{{If {{WaitForIEReady 30} = {{True};;{{ShowError}
%n
{Tab 2}
{{StringArtist
{ENTER}
{{If {{WaitForIEReady 30} = {{True};;{{ShowError}
%n
{Tab}
{Down}
{Tab}
{{StringSong
{ENTER}
{{If {{WaitForIEReady 30} = {{True};;{{ShowError}
{{If {{FindPattern 1, 959, 313, 600, 200, 0} = {{True};;{{ShowError}
{{Mouse 1, 1, {{VarFindPatternCoord_X_1}, {{VarFindPatternCoord_Y_1}, 0
{{If {{WaitForIEReady 30} = {{True};;{{ShowError}
%{F4}
%{F4}
{{SetVarDeltaTime {{Calc {{SerialTime} - {{VarTime}}
{{CreateDir C:\Temp
{{WriteLineToFile C:\Temp\DeltaTime.txt | Artist: {{StringArtist}, Song: {{StringSong}, Needed Time: {{VarDeltaTime} Seconds
{{WindowsAeroOn
{{MessageBox Artist: {{StringArtist}, Song: {{StringSong}, Needed Time: {{VarDeltaTime} Seconds

Remarks:
The macro has been created and tested on Windows 7 and IE 8
If you use other recources you might need to change the command %n (possibly using mouse clicks)

The second page with the "Details" is badly designed. By using Tab the active links are jumping through the advertisements before reaching Details. Therefore Tab can not be used for reaching Details (Advertising tends to change every day and then the needed amount of Tabs change too.) :-(
Therefore FindPattern is used. For using the above macro a pattern has to be recorded. Use the following settings: 600 /200 / 15 for pattern size. Pattern number one. Locate the cursor at the top left corner of "Details" (but within the text) for recording the pattern.
(For FindPattern also Windows Aero is switched off during the macro run)

The result (needed seconds) are written in C:\Temp\DeltaTime.txt and shown as message on the screen.

John Krauer, Kra-Tronic Corp.
admin
Site Admin
 
Posts: 219
Joined: 28 Oct 2005, 13:50


Return to Mouse and Key Recorder

Who is online

Users browsing this forum: No registered users and 1 guest

cron