Question about asserting an UI Element's existance

108 views
Skip to first unread message

Emir Özer

unread,
Sep 1, 2014, 6:20:56 AM9/1/14
to appium-...@googlegroups.com
Hey Appium PPL :)

First of all i would like to thank you for this awesome framework.

Let me get to the chase, here's my question: An example from the test scripts provided with Appium : 

# there is nav bar inside the app
nav_bar = self.driver.find_element_by_class_name("UIANavigationBar") self.assertTrue(nav_bar)

My question is that in this specific part, and parts like these in everyone's scripts, where we have to know if that element exists or not, 
is it really necessary to assert the element at all ? Isn't the find_element an assertion in the first place ?
I mean for this specific case if the interpreter moves to the self.assertTrue line doesn't that mean that the element already exists ?

Thanks in advance,

Emir


Disclaimer

This email is really important (well, most of them are.). Also, hopefully the message has been sent to the person it’s intended for. If we stuffed up by entering the wrong email address, we’re very sorry for cluttering up your inbox. But if we have done that, then please do us a favour and let us know…and if you could keep the juicy bits to yourself, that would be great too.

Also…stuff that’s said in this message are the views of the person writing the email and do not actually represent the views of Gramble World (although they might, but we’re just hedging our bets here). Don’t think for one minute that anything in this message should be construed as creating a contract.

Gramble World owns the email infrastructure, including the contents.

Finally…do the right thing by the environment and “think before you ink”!

**********************************************************************

Jonah Stiennon

unread,
Sep 2, 2014, 12:16:44 PM9/2/14
to appium-...@googlegroups.com
We've moved appium-discuss to discuss.appium.io
Can you post your issue there?

Thanks :)
Reply all
Reply to author
Forward
0 new messages