开发者

Remote WebDriver with Ruby issues

开发者 https://www.devze.com 2023-03-10 19:50 出处:网络
Folks, I am trying to setup remote webdriver in Ruby. I have worked extensively with Selenium before using Java but I am really new to Ruby. This is how my code looks like:

Folks,

I am trying to setup remote webdriver in Ruby. I have worked extensively with Selenium before using Java but I am really new to Ruby. This is how my code looks like:

@driver = Selenium::WebDriver.for(:remote, :url => "http://mysite:4444/wd/hub", :desired_capabilities => Selenium::WebDriver::Remote::Capabilities.firefox)
@driver.navigate.to homepage

The problem that I am seeing is the browser fires up on the remote machine but opens with a blank page. When I run the same code on开发者_C百科 the local machine the page opens fine. I am not sure what I am missing here.

This is the webdriver gem that I am using selenium-webdriver (0.2.1, 0.1.4) and I am using ruby ruby-1.9.2-p180


First download Selenium Server and run in local machine then

configure setup method like,

def setup
  @driver = Selenium::WebDriver.for(:remote, :url => 'http://192.168.0.188:4444/wd/hub', :desired_capabilities => :chrome)
  #@driver = Selenium::WebDriver.for :chrome
  @base_url = "http://www.google.com/"
  @driver.manage.timeouts.implicit_wait = 30
  @verification_errors = []
end

then run test cases from remote pc, will get executed in local machine. If you have any problem let me know.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号