Assert Condition fail but it's getting in and try to executing further.
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assert Condition fail but it's getting in and try to executing further.
Hi,
I have handle a dynamic web page by using if__Else condition.
Condition is false when i check but execution goes inside. What's the problem here. please help
please check the attachment for same.
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you sure that you are using the "Exist" and "Visible" prop in the right way?
I use Exists with boolean value like true or false
example:
if (obj.Exists == false) {
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Wamboo wrote:
Are you sure that you are using the "Exist" and "Visible" prop in the right way?
I use Exists with boolean value like true or false
example:
if (obj.Exists == false) {
Or, probably even more correct... to check for not exists
if (!obj.Exists)
to check for Exists
if (obj.Exists)
You don't need to compare to a boolean value, just use the boolean result.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for your reply.
Yes i am sure ..Assert condition that i am using is correct.
Consition is false but execution go inside.. (strange for me)
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We were talking about the "True" in if condition. Did You try to chang it for boolean true or false.
In my opinion you can't check bool value with string "True" value.
