Forum Discussion
It will be something like this
If button.exists then log.message("Pass") else log.message("Fail")
However, the object could be different (not always a button), the state could be different (not always exists), and you didn't tell us which scripting language. Hard to be more precise without more information.
There are also many events that are already found in the log so some of those might work for you as well.
Thanks .I am using Java scripting. other than if else statement, what can I use. I tried to use Log.message. It only prints the message does not specify whether its passed or fail.
- Marsha_R7 years agoChampion Level 3
TestComplete will not automatically know if it's passed or failed because it does not know what your conditions are. We are all testing different things and have different requirements. You may want to know if the button Exists and I may want to know if it's Visible. That's what a decision statement like If/Then/Else or Case does for you.
Log.message just puts out a string. You have to construct the test so it outputs the string you want.
- msap7 years agoFrequent Contributor
I tried to input the below Java script gives an error
if(Aliases.Framework.QA_EVT_A5_4.MdiClient.Exists) then log.message("Pass")
else log.message("fail");
or
if(Aliases.Framework.QA_EVT_A5_4.MdiClient.Exists) log.message("Pass")
else log.message("fail");
- Marsha_R7 years agoChampion Level 3
And what is the error that it gives?
- tristaanogre7 years agoEsteemed Contributor
Define "pass". Define "fail". You make the determination of whether or not something is passed or failed. Whatever you determine, enter it into the parameter for the message.
Related Content
- 9 years agoeasyfish
Recent Discussions
- 3 hours agosimonaferrara
- 11 hours agoSubhraDas
- 2 days agotramuntana