Advertisement
Guest User

Untitled

a guest
Oct 1st, 2019
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.79 KB | None | 0 0
  1. # Want to add enable-automation from here
  2. Selenium::WebDriver::Chrome::Options.new(options: {"excludeSwitches" => ["enable-automation"]})
  3. driver = Selenium::WebDriver.for :chrome, options: options
  4.  
  5. #to here
  6. chrome_options = Selenium::WebDriver::Chrome::Options.new
  7. chrome_preferences = {
  8.   plugins: {
  9.     always_open_pdf_externally: true
  10.   },
  11.   credentials_enable_service: false,
  12.   profile: {
  13.     name: "Chrome Testing",
  14.     password_manager_enabled: false
  15.   },
  16.   safebrowsing: {
  17.     enabled: true
  18.   },
  19.   'excludeSwitches': ['enable-automation'] #I have no idea what I'm doing.
  20. }
  21. chrome_preferences.each do |key, value|
  22.   chrome_options.add_preference key, value
  23. end
  24.  
  25. configuration[:options] = chrome_options
  26. @driver = Selenium::WebDriver::Abstractor.for browser_type, configuration
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement