Error pdf analysis in selenium webdriver ruby

I am trying to parse an online file through automation testing in selenium webdriver ruby.I tried to do according to this url " http://blog.bitcrowd.net/test-rails-pdf-output-with-cucumber/ ".

I get an error in this line

reader = PDF::Reader.new(StringIO.new(page.source)) 

It shows PDF does not contain EOF marker (PDF::Reader::MalformedPDFError)

I do not use capybara gem, so I can not use page.source instead of using driver.page_source . I would like to know if there is an equivalent method in selenium wedriver ruby ​​as page.source

+4
source share
1 answer

I would recommend using Pry and then placing

 binding.pry" 

in the test file so you can see what the webdriver gives you by running

 $> ls page 

or similar.

0
source

Source: https://habr.com/ru/post/1480194/


All Articles