The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
Difference between revisions of "STOPWATCH"
(→See Also: added links to !FILESTOPWATCH and !STOPWATCHTIME) |
|||
(15 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
Measures the time in seconds between two STOPWATCH commands with the same identifier. | Measures the time in seconds between two STOPWATCH commands with the same identifier. | ||
− | This command can be used for website response time measurement. Using different IDs in one macro different processes can be timed separately from each other. By default the measured data is stored in the download directory of iMacros. You can change the file location with the [[!FILESTOPWATCH]] variable. (PRO and SCRIPTING Editions only). | + | This command can be used for website response time measurement. Using different IDs in one macro different processes can be timed separately from each other. By default the measured data is stored in the download directory of iMacros. You can change the file location with the [[!FILESTOPWATCH]] variable. (PRO and SCRIPTING Editions only). The last measured response time value can be referenced in macro via the [[!STOPWATCHTIME]] variable. |
− | === Syntax [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]]=== | + | === Syntax [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]] [[Image:Cr-icon.png|Chrome]]=== |
STOPWATCH ID=id | STOPWATCH ID=id | ||
+ | |||
+ | Note that you need a matching pair, as this command returns the difference between two STOPWATCH commands. | ||
+ | |||
+ | Since V6.85+ you can also get the absolute time since macro start with | ||
+ | |||
+ | STOPWATCH LABEL=id | ||
+ | |||
+ | Since STOPWATCH LABEL returns the time since macro start, only '''one''' command per measurement is required. | ||
+ | |||
+ | Note: iMacros for Firefox V6.6.5 and later already contains the new iMacros V7 style stopwatch format. Please see [http://forum.iopus.com/viewtopic.php?f=11&t=8979&p=28990#p28990 this discussion for details] and to give feedback. | ||
=== Parameters === | === Parameters === | ||
Line 13: | Line 23: | ||
=== Examples === | === Examples === | ||
+ | The following screenshots are taken from our [http://www.iopus.com/imacros/support/workshop.htm#webtesting web testing workshop slides]: | ||
+ | |||
+ | [[Image:Performance report.png]] | ||
+ | |||
+ | [[Image:Performance report over time.png]] | ||
− | VERSION BUILD= | + | Example macro: |
− | SET !FILESTOPWATCH | + | VERSION BUILD=8031994 |
− | STOPWATCH ID= | + | TAB T=1 |
− | URL GOTO=http:// | + | TAB CLOSEALLOTHERS |
− | STOPWATCH ID= | + | ' |
− | TAG POS=1 TYPE=A ATTR=HREF:http:// | + | 'We can change the folder where the performance log file is going to be saved |
− | STOPWATCH ID=1 | + | 'by setting !FOLDER_STOPWATCH. Otherwise it is saved in iMacros\Downloads folder |
− | STOPWATCH ID=store | + | 'SET !FOLDER_STOPWATCH c:\Temp |
− | TAG POS=1 TYPE=A ATTR=TXT: | + | 'Note: Use SET !FOLDER_STOPWATCH NO if you do NOT need a response time log file |
− | TAG POS=1 TYPE= | + | '(for example, if you retrieve the values with the Scripting Interface via iimGetStopwatch) |
− | + | 'SET !FOLDER_STOPWATCH NO | |
− | + | 'SET !FILESTOPWATCH C:\Temp\demo-stopwatch.csv | |
− | + | ||
+ | ' | ||
+ | 'Start reponse time measurement | ||
+ | 'Measure total macro runtime | ||
+ | STOPWATCH ID=Total | ||
+ | 'Measure load time for first page | ||
+ | STOPWATCH ID=Firstpage | ||
+ | URL GOTO=http://demo.imacros.net/Automate/StopWatchDemo | ||
+ | STOPWATCH ID=Firstpage | ||
+ | |||
+ | TAG POS=1 TYPE=A ATTR=HREF:http://demo.imacros.net/Automate/AutoDataEntry | ||
+ | TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Automate/FormSubmit ATTR=NAME:fname CONTENT=Tom | ||
+ | TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Automate/FormSubmit ATTR=NAME:lname CONTENT=Testerr | ||
+ | 'Measure server reaction on submit | ||
+ | STOPWATCH ID=SubmitData | ||
+ | TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ID:demo ATTR=TXT:Submit | ||
+ | STOPWATCH ID=SubmitData | ||
+ | |||
+ | STOPWATCH ID=Store1 | ||
+ | 'Measure time for secure Online store to open | ||
+ | 'go to store | ||
+ | URL GOTO=http://imacros.net/overview | ||
+ | TAG POS=1 TYPE=A ATTR=TXT:*Buy* | ||
+ | 'open store => start timer | ||
+ | TAG POS=1 TYPE=A:BUTTON ATTR=TXT:Buy<SP>Now | ||
+ | STOPWATCH ID=Store1 | ||
+ | |||
+ | 'Measure time for second page | ||
+ | STOPWATCH ID=Total | ||
+ | |||
+ | WAIT SECONDS=2 | ||
+ | URL GOTO=http://demo.imacros.net/Automate/StopWatchReport | ||
+ | TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:path CONTENT="In iMacros Downloads folder" | ||
− | The file " | + | The file "performance_Stopwatch.csv" contains the measurement data. By default the data is saved to the Downloads\ directory of your iMacros installation. The values are comma separated (CSV format) so they can be viewed with any text editor or imported directly in Excel or any other software you use to view your data. |
Example file | Example file | ||
− | Format: Date, Time | + | Format: Date, Time, ID, time (s) |
− | " | + | "Date: 2013/02/11, Time: 11:00, Macro: Stopwatch.iim, Status: OK (1)" |
− | + | 2013/02/11,11:00:30,Firstpage,1.698 | |
− | + | 2013/02/11,11:00:33,SubmitData,0.555 | |
+ | 2013/02/11,11:00:34,Store1,8.045 | ||
+ | 2013/02/11,11:00:30,Total,11.256 | ||
=== See Also === | === See Also === | ||
− | [[!FILESTOPWATCH]], [[!STOPWATCHTIME]], [[REFRESH]], [[CLEAR]] | + | [[!FILESTOPWATCH]], [[!STOPWATCHTIME]], [[REFRESH]], [[CLEAR]], [[Demo-Stopwatch]], [[Get-Response-Times.vbs]], [[iimGetStopwatch]] |
Revision as of 15:20, 4 December 2017
Measures the time in seconds between two STOPWATCH commands with the same identifier.
This command can be used for website response time measurement. Using different IDs in one macro different processes can be timed separately from each other. By default the measured data is stored in the download directory of iMacros. You can change the file location with the !FILESTOPWATCH variable. (PRO and SCRIPTING Editions only). The last measured response time value can be referenced in macro via the !STOPWATCHTIME variable.
Syntax
STOPWATCH ID=id
Note that you need a matching pair, as this command returns the difference between two STOPWATCH commands.
Since V6.85+ you can also get the absolute time since macro start with
STOPWATCH LABEL=id
Since STOPWATCH LABEL returns the time since macro start, only one command per measurement is required.
Note: iMacros for Firefox V6.6.5 and later already contains the new iMacros V7 style stopwatch format. Please see this discussion for details and to give feedback.
Parameters
- ID
- Specifies an unique identifier for a timing measurement. Up to 100 different identifiers can be used.
Examples
The following screenshots are taken from our web testing workshop slides:
Example macro:
VERSION BUILD=8031994 TAB T=1 TAB CLOSEALLOTHERS ' 'We can change the folder where the performance log file is going to be saved 'by setting !FOLDER_STOPWATCH. Otherwise it is saved in iMacros\Downloads folder 'SET !FOLDER_STOPWATCH c:\Temp 'Note: Use SET !FOLDER_STOPWATCH NO if you do NOT need a response time log file '(for example, if you retrieve the values with the Scripting Interface via iimGetStopwatch) 'SET !FOLDER_STOPWATCH NO 'SET !FILESTOPWATCH C:\Temp\demo-stopwatch.csv ' 'Start reponse time measurement 'Measure total macro runtime STOPWATCH ID=Total 'Measure load time for first page STOPWATCH ID=Firstpage URL GOTO=http://demo.imacros.net/Automate/StopWatchDemo STOPWATCH ID=Firstpage TAG POS=1 TYPE=A ATTR=HREF:http://demo.imacros.net/Automate/AutoDataEntry TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Automate/FormSubmit ATTR=NAME:fname CONTENT=Tom TAG POS=1 TYPE=INPUT:TEXT FORM=ACTION:/Automate/FormSubmit ATTR=NAME:lname CONTENT=Testerr 'Measure server reaction on submit STOPWATCH ID=SubmitData TAG POS=1 TYPE=BUTTON:SUBMIT FORM=ID:demo ATTR=TXT:Submit STOPWATCH ID=SubmitData STOPWATCH ID=Store1 'Measure time for secure Online store to open 'go to store URL GOTO=http://imacros.net/overview TAG POS=1 TYPE=A ATTR=TXT:*Buy* 'open store => start timer TAG POS=1 TYPE=A:BUTTON ATTR=TXT:Buy<SP>Now STOPWATCH ID=Store1 'Measure time for second page STOPWATCH ID=Total WAIT SECONDS=2 URL GOTO=http://demo.imacros.net/Automate/StopWatchReport TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:path CONTENT="In iMacros Downloads folder"
The file "performance_Stopwatch.csv" contains the measurement data. By default the data is saved to the Downloads\ directory of your iMacros installation. The values are comma separated (CSV format) so they can be viewed with any text editor or imported directly in Excel or any other software you use to view your data.
Example file Format: Date, Time, ID, time (s)
"Date: 2013/02/11, Time: 11:00, Macro: Stopwatch.iim, Status: OK (1)" 2013/02/11,11:00:30,Firstpage,1.698 2013/02/11,11:00:33,SubmitData,0.555 2013/02/11,11:00:34,Store1,8.045 2013/02/11,11:00:30,Total,11.256
See Also
!FILESTOPWATCH, !STOPWATCHTIME, REFRESH, CLEAR, Demo-Stopwatch, Get-Response-Times.vbs, iimGetStopwatch