File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change 3030 config . after { @driver &.quit }
3131
3232 def start_session
33- options = Selenium ::WebDriver ::Chrome ::Options . new
34- options . add_argument ( 'disable-search-engine-choice-screen' )
35- options . add_argument ( '--no-sandbox' )
36- @driver = Selenium ::WebDriver . for ( :chrome , options : options )
33+ @service = Selenium ::WebDriver ::Service . chrome
34+ @driver = Selenium ::WebDriver . for :chrome , options : default_chrome_options
3735 end
3836
3937 def start_bidi_session
40- options = Selenium ::WebDriver ::Chrome ::Options . new ( web_socket_url : true )
38+ options = default_chrome_options
39+ options . web_socket_url = true
4140 @driver = Selenium ::WebDriver . for :chrome , options : options
4241 end
4342
43+ def default_chrome_options
44+ options = Selenium ::WebDriver ::Chrome ::Options . new
45+ options . browser_version = 'stable'
46+ options . timeouts = { implicit : 500 }
47+ options . add_argument ( 'disable-search-engine-choice-screen' )
48+ options . add_argument ( '--no-sandbox' ) if Selenium ::WebDriver ::Platform . os == :linux
49+ options
50+ end
51+
4452 def start_firefox
4553 options = Selenium ::WebDriver ::Options . firefox ( timeouts : { implicit : 1500 } )
54+ options . browser_version = 'stable'
4655 @driver = Selenium ::WebDriver . for :firefox , options : options
4756 end
4857end
You can’t perform that action at this time.
0 commit comments