Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4616

SitePrism sometimes finds elements, sometimes doesn't, while Capybara can

$
0
0

I am using Capybara and Selenium for testing my website. I also use with Site Prism for Page Object model. I can make every thing work now, however, I don't understand why sometimes actions with page elements donot work, while using "natively" Capybara work.
For example, I have a Page object:

class MyPage < SitePrism::Page element :sign_in_link, :css, 'a.signin-link' element :join_link, :css, "a.join-link"end

and its implementation:

@mypage = MyPage.new@mypage.sign_in_link.click# It works at first, then after some repeated test round, it doesn't work sometimes, with error: NoMethodError

While I use:

find(:css, 'a.signin-link').click #=> always work, but not Page Object model

So, why it happens? Have anyone experienced this problem?


Viewing all articles
Browse latest Browse all 4616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>