<rss version="2.0" xmlns:a10="http://www.w3.org/2005/Atom"><channel><title>Inflectra Customer Forums: If statements (Thread)</title><description> 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 cant 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        } </description><language>en-US</language><copyright>(C) Copyright 2006-2026 Inflectra Corporation.</copyright><managingEditor>support@inflectra.com</managingEditor><category domain="http://www.dmoz.org">/Computers/Software/Project_Management/</category><category domain="http://www.dmoz.org">/Computers/Software/Quality_Assurance/</category><generator>KronoDesk</generator><a10:contributor><a10:email>support@inflectra.com</a10:email></a10:contributor><a10:id>http://www.inflectra.com/kronodesk/forums/threads</a10:id><ttl>120</ttl><link>/Support/Forum/rapise/issues-questions/2831.aspx</link><item><guid isPermaLink="false">threadId=2831</guid><author>Steve Harris (sharris21972@gmail.com)</author><title>If statements</title><description> 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 cant 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        } </description><pubDate>Thu, 27 Jul 2023 17:24:35 -0400</pubDate><a10:updated>2023-07-28T05:41:07-04:00</a10:updated><link>/Support/Forum/rapise/issues-questions/2831.aspx</link></item><item><guid isPermaLink="false">messageId=6163</guid><author>Max K (denis.markovtsev@inflectra.com)</author><title> Hi Sharris,  If you do just if statement then in JavaScript it will be   if( SeS('Log_In').GetText(</title><description> 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 </description><pubDate>Fri, 28 Jul 2023 05:41:07 -0400</pubDate><a10:updated>2023-07-28T05:41:07-04:00</a10:updated><link>/Support/Forum/rapise/issues-questions/2831.aspx#reply6163</link></item></channel></rss>