0

I have HTML Tidy extension installed in chrome.

When I do:

b = Watir::Browser.new :chrome

The Chrome browser opens up but without extension.

So I used following:

b = Watir::Browser.new (:chrome, :switches => %w[--load-extension=
"C:\Users\.....\AppData\Local\Google\Chrome\UserData\Default\Extensions\gljdonhfjnfdklljmfaabfpjlonflfnm"])

This opens the Chrome browser with an extension

But after few seconds it gives me error:

[0402/141412:ERROR:proxy_launcher.cc(551)] Failed to wait for testing channel presence. test\automation\proxy_launcher.cc(477): error: Value of: automation_proxy_.get()

Actual: false Expected: true Timeout::Error: Timeout::Error

I did a search and it looks like a chromedriver bug.

I am using Chromedriver version : 26.0.1383.0

Has anyone come across this issue? Can some one please suggest a work around if one is available?

Ryan
  • 5,644
  • 3
  • 38
  • 66
UserPD
  • 21
  • 4
  • Please describe the problem that HTML Tidy solves for you. If nothing, the. Don't use it. If you want to capture clean HTML, perhaps you clean it post-grabbing it. Also. I saw a HTML Tidy plugin for Firefox. – Dave McNulla Apr 03 '13 at 15:00
  • I am going to use HTML tidy to grab the HTML errors and warnings and generate report for our new builds. I am using our existing automation framework watir-webdriver for this. – UserPD Apr 03 '13 at 17:51
  • I have found a solution to this issue. Basically just remove the quotation and replace back slash with forward slashed and escape character for space within the path. It launches fine. – UserPD Apr 03 '13 at 17:53
  • You should post the exact code that solved your problem as an answer and accept it, that way if someone else runs into this issue, this question will not appear to be unanswered – Chuck van der Linden Apr 03 '13 at 17:56

1 Answers1

0

The Ruby library Nokogiri can check for well formed markup. Then you are not dependant on browser things. You can capture the html from Watir-Webdriver. Or you can capture it from net/http.

require "net/http"
require "uri"
require "nokogiri"

uri = URI.parse("http://www.google.com")
response = Net::HTTP.get_response(uri)
puts parse_body(response.body)

def parse_body(response)
  begin
    return Nokogiri::XML(response) { |config| config.strict }
  rescue Nokogiri::XML::SyntaxError => e
    return "caught exception: #{e}"
  end
end
Dave McNulla
  • 2,006
  • 16
  • 23