Skip Navigation LinksHome Page > Forums > Rapise Forums > Rapise Issues & Questions > If statements
Hello,
I have been learning a bit about automation and javascript. I am very much a novice so I appoligige if this question is dub. I am trying to do an if statement to verify text but I can't get it to run. Could somone advise me on how to get this working?
if (Tester.AssertEqual("Verify that: Text=Log In", SeS('Log_In').GetText(), "Log In") == "Log In");
{ Tester.AssertEqual("Verify that: Text=Log In", SeS('Log_Out').GetText(), "Log In"); }
else
{ Tester.AssertEqual("Num2", SeS('Log_Out').GetText(), "Log In"); }
Hi Sharris,
If you do just if statement then in JavaScript it will be
if( SeS('Log_In').GetText() == "Log In" ) { Tester.Message("Inside if statement"); } // or if( SeS('Log_In').GetText() == "Log In" ) { Tester.Message("Inside if statement"); } else { Tester.Message("Inside else branch"); }
Also you may do an Assert statement
Tester.AssertEqual("Verify that: Text=Log In", SeS('Log_In').GetText(), "Log In" );
Regards,Max
And if you have any questions, please email or call us at +1 (202) 558-6885