I have a newbie question, that I have never seen discussed here. Witch means that it most probably is not possible.
We are using Agile methods, which means that I script before any environment is up and running.
Now I've scripted as much I can programatically, but is there any way that I can run my scripts to test/debug them without having an interface to run on? [img]/images/graemlins/smile.gif[/img]
- How many testers do you need to switch a light bulb? None, we just report it's dark -
Its only possible to test the functional behaviour of the script with the gui objects - not app functionality or even gui functionality.
To do this you would need something to connect to (an app with the edits/lists/tables/buttons/whatever the AUT has) and an object identification map/system that is not app/script dependent. Switching the object ID to the test app would mean that you could potentially run the script to determine if/not the script basically works. Once the app appears switch to the app's object ID map and let it go.
[ QUOTE ]
But how can one simluate the scenario of testing all his scripts which is dependant on the functional behaviour of the app.
[/ QUOTE ]
When the app truly exists in no format (if it does then Tarun's suggestion is likely best) you can (painfully!) use the debugger and set breakpoints to step around the UI dependent statements. This approach though probably requires some discipline in how you code. For example:
if Browser("X").ObjectBlah("Y).Exist Then ...
if bExists Then ...
I find my GUI object references are small in comparison the the number of lines of "processing" code, so this approach makes sense, at least in that scenario.
My screenshot captures are done via a function, one of the filds passed is Mode, if mode = "Debug" then the screen captures are not taken, this speeds up the debug process.
Perhaps you could have a realApp flag and do something similar with If statements:
If Not realAppFlag Then
If Browser("X").ObjectBlah("Y).Exist Then
If bExists Then
... Do Exists
... Do Not Exists
This way you don't need to change code when the app is/isn't available