GithubHelp home page GithubHelp logo

rdee's People

Contributors

cheezy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rdee's Issues

Confused about how to run Hub

using both

  RDee.configure do |c|
    c.url = 'http://192.168.10.10:4444/wd/hub'
  end
  browser = RDee.selenium_browser

and

  RDee.configure do |c|
    c.url = 'http://192.168.10.10:4444/wd/hub'
  end
  browser = RDee.watir_browser

gives me the error

Timeout::Error
Timeout::Error (RDee::ConnectionError)
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/RDee-0.3/lib/rdee/browser_factory.rb:48:in `rescue in selenium_browser_for'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/RDee-0.3/lib/rdee/browser_factory.rb:40:in `selenium_browser_for'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/RDee-0.3/lib/rdee/browser_factory.rb:21:in `selenium_browser'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/RDee-0.3/lib/RDee.rb:92:in `selenium_browser'
C:/Users/tyler.thrailkill/Documents/recondo/tools/watir2_0/trunk/features/support/env.rb:96:in `create_browser'
C:/Users/tyler.thrailkill/Documents/recondo/tools/watir2_0/trunk/features/support/hooks.rb:3:in `<top (required)>'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:94:in `load'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/rb_support/rb_language.rb:94:in `load_code_file'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:237:in `load_file'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:97:in `block in load_files!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:96:in `each'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime/support_code.rb:96:in `load_files!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime.rb:242:in `load_step_definitions'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/runtime.rb:65:in `run!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/lib/cucumber/cli/main.rb:38:in `execute!'
C:/tools/ruby193/lib/ruby/gems/1.9.1/gems/cucumber-2.0.0/bin/cucumber:9:in `<top (required)>'
C:/tools/ruby193/bin/cucumber:23:in `load'
C:/tools/ruby193/bin/cucumber:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'

I'm unsure of what I'm doing wrong.

The cucumber.yml looks like this

% common = "FIG_NEWTON_FILE=server1.yml RDEE_BROWSER=chrome -r features"
% pretty_format = "--color --format pretty"
% html_format = "--format html --out cucumber_run_output/html_report/report.html"
% json_format = "--format json --out cucumber_run_output/json_reports/report.json"
% exclude = "-t ~@wip -t ~@not_ready"

default: <%= common %> <%= pretty_format %> <%= html_format %> <%= exclude %>

Can you add additional desired capabilities?

Looking at the RDee code, it appears that :desired_capabilities is overwritten as it is explicitly set after the options.merge

   def platform_and_options(target, options)
      target = ENV['RDEE_BROWSER'].to_sym if ENV['RDEE_BROWSER'] 
      platform, version, host = parse(target)
      options.merge! additional_options_for target
      capabilities = capabilities(platform, version, host)
      options[:url] = url unless url.nil?
      if options.include? :url
        platform = :remote
        options[:desired_capabilities] = capabilities
      end
      options[:http_client] = http_client if persistent_http or options.delete(:persistent_http)
      return platform, options
    end

as such, how can we add our own desired capabilities @cheezy ?

Question: Setting preferences for remote chrome browser

Hi Cheezy, first off - great gem!

I need to add preferences for my remote browser, for example here is a copy of my local chrome configuration:


  $download_directory = File.join("#{Dir.pwd}/_cucumber", 'tmp_downloads')
  FileUtils.mkdir_p $download_directory

  prefs = {
      download: {
          prompt_for_download: false,
          directory_upgrade: true,
          default_directory: $download_directory
      },
      safebrowsing: {
          enabled: true
      }
  }

  switches = %w(--ignore-certificate-errors --disable-popup-blocking)

  caps = Selenium::WebDriver::Remote::Capabilities.chrome
  caps['chromeOptions'] = { 'prefs' => prefs }

  @browser = RDee.watir_browser(target = :chrome, options = {prefs: prefs, switches: switches})
end

This works great locally, however when I try to run on a remote machine with the following:

Before('@remote_chrome') do
  $download_directory = File.join("#{Dir.pwd}/_cucumber", 'tmp_downloads')
  FileUtils.mkdir_p $download_directory

  prefs = {
      download: {
          prompt_for_download: false,
          directory_upgrade: true,
          default_directory: $download_directory
      },
      safebrowsing: {
          enabled: true
      }
  }

  switches = %w(--ignore-certificate-errors --disable-popup-blocking)
  caps = Selenium::WebDriver::Remote::Capabilities.chrome
  caps['chromeOptions'] = { 'prefs' => prefs }

  @browser = RDee.watir_browser(target = :chrome, options = {url: 'http://192.168.99.100:4444/wd/hub', prefs: prefs, switches: switches})

end

The above throws an error

'unknown options: {:prefs=>{:download=>{:prompt_for_download=>false, :directory_upgrade=>true, :default_directory=>"/Users/Ian/Documents/workspace/_cucumber/tmp_downloads"}, :safebrowsing=>{:enabled=>true}}, :switches=>["--ignore-certificate-errors", "--disable-popup-blocking"]}'

I've tried several variations on the above without success. Any idea where I am going wrong?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.