CallScript command doesn't reset the SubWindow count

How to apply eValid to functional testing of web applications.

CallScript command doesn't reset the SubWindow count

Postby rguerra » Mon Jun 04, 2012 12:27 pm

In the post below you give the CallScript command as a method to run a script multiple times. However if you run the script that I have provided you will see that eValid does not reset the subwindow count therefore any subsequent run fails to sync the subwindow. I have written a short sample script = that can be run to illustrate my point.

Am I missing something, do you know a way around this? Can eValid reset the window count?

How do I go about running a test ten times in a row?

#### Start of script

Code: Select all
# Got to linkedIn.com
InitLink "http://www.linkedin.com/"
SyncOnElementProperty 0 "innerText" "Copyright Policy" ""

# Click on the Help Center link
IndexSet 0
IndexFindElement 0 DOWN "innerText" "Help Center" ""
ResetTimer
IndexFollowLink 0 ""
SyncOnElementProperty 1 "innerText" "Welcome!" ""

# Close the subwindow
WindowClose 1

# Got to evestment.com
GotoLinkSubmit 0 "evestment.com" ""
rguerra
 
Posts: 1
Joined: Tue Jun 21, 2011 4:29 am

Re: CallScript command doesn't reset the SubWindow count

Postby eValid » Mon Jun 04, 2012 12:35 pm

In one eValid playback the starting window is numbered "0" and each subsequent window that opens is given the next number, "1", "2", "3", for example.

Even if a script closes, for example, window "2", the next one opened will be in sequence from the start, "4" for example.

The CallScript command incorporates the called script into the sequence of commands executed during playback. Each of called script therefore is part of the same playback, so all of the windows will be numbered differently, even if you suppress (close) one of them.

Given what you want to do there are several options.

Option 1: Separate eValid Instances

Run the script in separate instances of eValid. If each playback starts the numbering from "0" again, then all of the subscreen numbers will be "1", as you wish.

You could do this from a sequence of evalid batch commands using the command line interface:

eValid -- Command Line Interface

Or, you could run the same commands form within eValid using the SystemCall command, each of which create a new instance of evalid.

Option 2: Parameterize the Script

If you convert the window number in your script to, $WINDOW, then you could have a series of CallScript commands like this:

CallScript script "$WINDOW=1"
CallScript script "$WINDOW=2"
CallScript script "$WINDOW=3"
CallScript script "$WINDOW=4"

In this case the natural window-opening order is preserved in a single script, but the actions taken in the called script are then correct relative to the sequential window number.

_________________
eValid Tech Support
eValid
 
Posts: 2396
Joined: Tue Jan 01, 2008 12:48 pm
Location: USA


Return to Desktop and Mobile Device Functional Testing

Design Downloaded from free phpBB templates | free website templates | Free Web Buttons