-
Notifications
You must be signed in to change notification settings - Fork 1
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
displayed? *** NoMethodError Exception: undefined method `key' for #12
Comments
Hello @serhatbolsu web-object gem has a workaround to it.. while declaring the element, pass a false parameter..
This will return a false instead of throwing an error so it can be used as:
But your point is duly noted, it will be good to have a Let me know if you have more questions... |
workaround is ok , but still requires a lot of code change considering I have alot of tests. wouldnt it be nice that somehow you override .displayed? so that method would respond, |
I believe changing native behaviour of .displayed? method is not a good idea.. Main purpose of web-object gem is to provide all the native webdriver flavours but with a clean way of implementing page-objects.. But yes I have taken in your issue and a fix will be out.. I can think of something generic and implement a property in which u can set initially in your setup code that when elements are not found, do not raise an error instead return a boolean false.. Also feel free to fork and submit a pull-request.. |
"NoMethodError Exception: undefined method `key' " |
Hi,
During the usage of
element
I would like to use.displayed?
. If the item is not displayed instead of gettingI get
*** NoMethodError Exception: undefined method
key' for [:css, ".bioinfo_personal .title"]:Array`Example:
Definition:
element :details_broker_name, {css: ".bioinfo_personal .title"}
Usage:
expect(brokers.details_broker_name.displayed?).to be true
Not getting "element not found" exception is hardening the debug-ability of test cases.
The text was updated successfully, but these errors were encountered: