mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Swallow JS error when attempting to get page source with selenium driver
This commit is contained in:
parent
edb5e88e7a
commit
e7e42401c1
1 changed files with 4 additions and 0 deletions
|
@ -85,6 +85,10 @@ class Capybara::Selenium::Driver < Capybara::Driver::Base
|
|||
|
||||
def html
|
||||
browser.page_source
|
||||
rescue Selenium::WebDriver::Error::JavascriptError => e
|
||||
return '' if e.match?(/documentElement is null/)
|
||||
|
||||
raise
|
||||
end
|
||||
|
||||
def title
|
||||
|
|
Loading…
Add table
Reference in a new issue