Forum Discussion
rmanning
16 years agoContributor
Wow. I'm doing pretty well at answering my own questions. I figured it out, by setting a Variable in my KeywordTest and using the method described here: http://www.automatedqa.com/forums/forum/post/?mode=singlethread&thread=f4f9ec73-0f9a-4daa-b464-4979166ac90f
1. Creat a Vaiable under the "Variables" tab in the KeyWordTest that you are running the script routine from.
2. Give it any name and make it an integer with a default value of 0 (or whatever number you wish to start at)
3. Create a script routine and use the following:
Sub Main
Sys.Desktop.ActiveWindow().Picture.SaveToFile "C:\TEMP\Desktop" + VarToStr(KeywordTests.YourKeywordTest.Variables.Var1) + ".jpg"
End Sub
4. Add the "Set Variable Value" to your KeyWordTest Steps window (before or after the "Run Script Routine" of the script above) and use the following: Use a variable of the Integer type. To increment its value, on the "Set New Value" page of the "Set Variable Value" dialog choose the "Code Expression" mode and set Value to "Project.Variables.YourVariableName + 1" (without quotes).
That's it.
1. Creat a Vaiable under the "Variables" tab in the KeyWordTest that you are running the script routine from.
2. Give it any name and make it an integer with a default value of 0 (or whatever number you wish to start at)
3. Create a script routine and use the following:
Sub Main
Sys.Desktop.ActiveWindow().Picture.SaveToFile "C:\TEMP\Desktop" + VarToStr(KeywordTests.YourKeywordTest.Variables.Var1) + ".jpg"
End Sub
4. Add the "Set Variable Value" to your KeyWordTest Steps window (before or after the "Run Script Routine" of the script above) and use the following: Use a variable of the Integer type. To increment its value, on the "Set New Value" page of the "Set Variable Value" dialog choose the "Code Expression" mode and set Value to "Project.Variables.YourVariableName + 1" (without quotes).
That's it.