-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update default method to check if element displayed to always return … #83
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,9 +91,15 @@ public String toString() { | |
* @return Whether or not the element is displayed | ||
*/ | ||
public boolean isDisplayed() { | ||
return getWrappedElement().isDisplayed(); | ||
try{ | ||
return getWrappedElement().isDisplayed(); | ||
} catch (Exception e) { | ||
//ignore and return false to indicate element is not visible. | ||
} | ||
return false; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you're presuming that if element isn't found (this is when exception is thrown), then it's invisible. But this is hiding that fact (that element wasn't found) from the developer who runs the tests and therefore I think it's not the right way to handle this. Instead you should be catching that exception in place where you call |
||
} | ||
|
||
|
||
/** | ||
* Is the element currently enabled or not? This will generally return true for everything but | ||
* disabled input elements. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either log or rethrow this exception.