Forum Discussion
- Marsha_R
Champion Level 3
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.
- msapFrequent Contributor
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_R
Champion 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.