Has element.isDisplayed method been removed from latest rspec

11 views
Skip to first unread message

Shivam Tiwari

unread,
Jul 30, 2018, 4:39:20 AM7/30/18
to rspec
Getting undefined method `displayed?' for #<Watir::Select:0x0000000a6b0238> error

Jon Rowe

unread,
Jul 30, 2018, 4:42:59 AM7/30/18
to rs...@googlegroups.com
Hi Shivam

Without a code snippet showing what you’re trying to do it’s hard to help here, but Watir is not integrated into RSpec so if they changed something its possible to break in this fashion. Also note that `element.isDisplayed` is not part of any RSpec code, and I’m unsure where it would be from as Ruby convention specifies using snake case for names. There is an RSpec matcher that would call `displayed?` but it would be `expect(element).to be_displayed` to invoke it.

Cheers
Jon Rowe
---------------------------

On Monday, 30 July 2018 at 09:20, Shivam Tiwari wrote:

Getting undefined method `displayed?' for #<Watir::Select:0x0000000a6b0238> error

--
You received this message because you are subscribed to the Google Groups "rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rspec+un...@googlegroups.com.
To post to this group, send email to rs...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rspec/cf9622ce-5ed1-4ff4-8631-56e8ee0fea53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Shivam Tiwari

unread,
Jul 30, 2018, 5:25:21 AM7/30/18
to rspec
Hi Jon,

Thanks for the reply.

Below are the code where i am getting error.

#page object
images :check, :css=>".blocks"

# page methods
def progress_status
   wait_for(self.check_element.displayed?)   // Showing error in this line
end

error console:
undefined method `displayed?' for #<Watir::Div:0x0000000a8a8a90>
Did you mean?  display (NoMethodError)

Working on : Rspec(3.7.0) ,  firefox:61  , gecko driver:0.21.0

Thanks,
Shivam

Jon Rowe

unread,
Jul 30, 2018, 6:27:36 AM7/30/18
to rs...@googlegroups.com
Hi Shivam

The error you are getting is entirely from watir, apparently the method you are looking for (following a quick google) is `visible?`.

Cheers

Jon Rowe
---------------------------

Reply all
Reply to author
Forward
0 new messages