0

Selenium テストで browsermob プロキシを使用しようとしています。したがって、次のコードを書きました。

require 'selenium-webdriver'
require 'browsermob/proxy'

server = BrowserMob::Proxy::Server.new ".//browsermob-proxy-2.0-beta-8//"
server.start

しかし、上記のスクリプトを実行すると、Access is denied. (5) (ChildProcess::LaunchError)エラーが発生します。

c:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.3.6/lib/childprocess/windows/process_builder.rb:87:in `create_process': Access is denied. (5) (ChildProcess::LaunchError)
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.3.6/lib/childprocess/windows/process_builder.rb:34:in `start'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.3.6/lib/childprocess/windows/process.rb:63:in `launch_process'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/childprocess-0.3.6/lib/childprocess/abstract_process.rb:67:in `start'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/browsermob-proxy-0.1.3/lib/browsermob/proxy/server.rb:27:in `start'
        from test.rb:6:in `<main>'

エラーを取り除くのを手伝ってください。

4

1 に答える 1

0

私は同じ問題に直面しましたが、こちらのドキュメントから、 browsermob-proxy サーバーへのパスにも実行可能ファイルを含める必要があることを理解するのは困難でした。

あなたの場合、コードは次のようになります。

require 'selenium-webdriver'
require 'browsermob/proxy'

server = BrowserMob::Proxy::Server.new ".//browsermob-proxy-2.0-beta-8//bin//browsermob-proxy.bat"
server.start

それが役に立てば幸い

于 2014-01-13T14:10:24.070 に答える