Desired_capabilities has been deprecated and removed

I was getting this error after upgrading selenium and other depended libraries. I updated the browser code but facing some issues. If I run chrome and its running in Firefox and also getting some errors. Please guide me what needs to be change in below code. Currently getting TypeError: WebDriver.init() got an unexpected keyword argument ‘browser_profile’

${chrome options} = Evaluate sys.modules[‘selenium.webdriver’].ChromeOptions() sys
&{bstack_options} Create Dictionary os=Windows osVersion=10 browserVersion=124
${remoteUrl} Set Variable #BrowserStack URL goes here
&{desiredCapabilities} Create Dictionary browserName=Chrome selenium_version=4.1.0 use_w3c=false options.set_capability=${bstack_options} keep_alive=true
Open Browser remote_url=${remoteUrl} desired_capabilities=${desiredCapabilities} options=${chrome options}

1 Like

Sorry the error that I am getting is " Currently getting “desired_capabilities has been deprecated and removed. Please use options to configure browsers as per documentation.”

Looks like that was deprecated with SeleniumLibrary 6.1.3 (current version is 6.4.0) as it was deprecated by Selenium, so not much SeleniumLibrary can do about that.

I guess your options are:

  • use an older unsupported version of SeleniumLibrary and Selenium
  • find out the new way to do the same thing and update your scripts

Sorry I’m not familiar with the functionality so not able to help much, hopefully this is helpful

Dave.