Is it possible to call different scripts based on different results?
User Ratnesh Gautam (email@example.com) posted:
I'd like to do the following:
If I click a button I expect to get back 1 of 2 windows. Depending on
window is displayed I would like to call upon specific scripts.
Is it possible to somehow check which window is being displayed and then
call scripts based upon which one is being displayed?
e.g. of pseudo code
if Check Result = window 1
then Call Script "Scripts for Window 1"
else if Check Result = window 2
then Call Script "Scripts for Window 2"
Can this be done in Rational Robot?
Re: Is it possible to call different scripts based on different results?
User (firstname.lastname@example.org) posted:
I assume you know the recMethods for each of the possible expected windows?
If so then the solution is simple:
sWindow1 = "\;Type=Window;Caption=Window #1"
sWindow2 = "\;Type=Window;Caption=Window #2"
If sqaFindObject(sWindow1) = sqaSuccess Then
Else If sqaFindObject(sWindow2) = sqaSuccess Then
'Panic, because something unexpected happened
SQA Engineer, IBU-SOPL (Tektronix)