Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I have the following spec:

it "deletes post", :js => true do 

...

...

page.status_code.should = '404'

end 

The page.status_code line is giving me this error:

Capybara::NotSupportedByDriverError

How do I check the page's status code?

1 Answer

0 votes
by (62.9k points)

As a remark. This line

page.status_code.should = '404'

Should be

page.status_code.should == 404

This worked for me with capybara-webkit.

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s Selenium automation online training!

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

30.5k questions

32.6k answers

500 comments

108k users

Browse Categories

...