Python selenium.webdriver.common.desired_capabilities.DesiredCapabilities.OPERA Examples
The following are 6
code examples of selenium.webdriver.common.desired_capabilities.DesiredCapabilities.OPERA().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
selenium.webdriver.common.desired_capabilities.DesiredCapabilities
, or try the search function
.
Example #1
Source File: DriverFactory.py From qxf2-page-object-model with MIT License | 10 votes |
def run_sauce_lab(self,os_name,os_version,browser,browser_version): "Run the test in sauce labs when remote flag is 'Y'" #Get the sauce labs credentials from sauce.credentials file USERNAME = remote_credentials.USERNAME PASSWORD = remote_credentials.ACCESS_KEY if browser.lower() == 'ff' or browser.lower() == 'firefox': desired_capabilities = DesiredCapabilities.FIREFOX elif browser.lower() == 'ie': desired_capabilities = DesiredCapabilities.INTERNETEXPLORER elif browser.lower() == 'chrome': desired_capabilities = DesiredCapabilities.CHROME elif browser.lower() == 'opera': desired_capabilities = DesiredCapabilities.OPERA elif browser.lower() == 'safari': desired_capabilities = DesiredCapabilities.SAFARI desired_capabilities['version'] = browser_version desired_capabilities['platform'] = os_name + ' '+os_version return webdriver.Remote(command_executor="http://%s:%s@ondemand.saucelabs.com:80/wd/hub"%(USERNAME,PASSWORD), desired_capabilities= desired_capabilities)
Example #2
Source File: DriverFactory.py From makemework with MIT License | 8 votes |
def run_browserstack(self,os_name,os_version,browser,browser_version,remote_project_name,remote_build_name): "Run the test in browser stack when remote flag is 'Y'" #Get the browser stack credentials from browser stack credentials file USERNAME = remote_credentials.USERNAME PASSWORD = remote_credentials.ACCESS_KEY if browser.lower() == 'ff' or browser.lower() == 'firefox': desired_capabilities = DesiredCapabilities.FIREFOX elif browser.lower() == 'ie': desired_capabilities = DesiredCapabilities.INTERNETEXPLORER elif browser.lower() == 'chrome': desired_capabilities = DesiredCapabilities.CHROME elif browser.lower() == 'opera': desired_capabilities = DesiredCapabilities.OPERA elif browser.lower() == 'safari': desired_capabilities = DesiredCapabilities.SAFARI desired_capabilities['os'] = os_name desired_capabilities['os_version'] = os_version desired_capabilities['browser_version'] = browser_version if remote_project_name is not None: desired_capabilities['project'] = remote_project_name if remote_build_name is not None: desired_capabilities['build'] = remote_build_name+"_"+str(datetime.now().strftime("%c")) return webdriver.Remote(RemoteConnection("http://%s:%s@hub-cloud.browserstack.com/wd/hub"%(USERNAME,PASSWORD),resolve_ip= False), desired_capabilities=desired_capabilities)
Example #3
Source File: DriverFactory.py From makemework with MIT License | 8 votes |
def run_sauce_lab(self,os_name,os_version,browser,browser_version): "Run the test in sauce labs when remote flag is 'Y'" #Get the sauce labs credentials from sauce.credentials file USERNAME = remote_credentials.USERNAME PASSWORD = remote_credentials.ACCESS_KEY if browser.lower() == 'ff' or browser.lower() == 'firefox': desired_capabilities = DesiredCapabilities.FIREFOX elif browser.lower() == 'ie': desired_capabilities = DesiredCapabilities.INTERNETEXPLORER elif browser.lower() == 'chrome': desired_capabilities = DesiredCapabilities.CHROME elif browser.lower() == 'opera': desired_capabilities = DesiredCapabilities.OPERA elif browser.lower() == 'safari': desired_capabilities = DesiredCapabilities.SAFARI desired_capabilities['version'] = browser_version desired_capabilities['platform'] = os_name + ' '+os_version return webdriver.Remote(command_executor="http://%s:%s@ondemand.saucelabs.com:80/wd/hub"%(USERNAME,PASSWORD), desired_capabilities= desired_capabilities)
Example #4
Source File: DriverFactory.py From qxf2-page-object-model with MIT License | 8 votes |
def run_browserstack(self,os_name,os_version,browser,browser_version,remote_project_name,remote_build_name): "Run the test in browser stack when remote flag is 'Y'" #Get the browser stack credentials from browser stack credentials file USERNAME = remote_credentials.USERNAME PASSWORD = remote_credentials.ACCESS_KEY if browser.lower() == 'ff' or browser.lower() == 'firefox': desired_capabilities = DesiredCapabilities.FIREFOX elif browser.lower() == 'ie': desired_capabilities = DesiredCapabilities.INTERNETEXPLORER elif browser.lower() == 'chrome': desired_capabilities = DesiredCapabilities.CHROME elif browser.lower() == 'opera': desired_capabilities = DesiredCapabilities.OPERA elif browser.lower() == 'safari': desired_capabilities = DesiredCapabilities.SAFARI desired_capabilities['os'] = os_name desired_capabilities['os_version'] = os_version desired_capabilities['browser_version'] = browser_version if remote_project_name is not None: desired_capabilities['project'] = remote_project_name if remote_build_name is not None: desired_capabilities['build'] = remote_build_name+"_"+str(datetime.now().strftime("%c")) return webdriver.Remote(RemoteConnection("http://%s:%s@hub-cloud.browserstack.com/wd/hub"%(USERNAME,PASSWORD),resolve_ip= False), desired_capabilities=desired_capabilities)
Example #5
Source File: test_config_driver.py From toolium with Apache License 2.0 | 5 votes |
def test_create_local_driver_opera(webdriver_mock, config): config.set('Driver', 'type', 'opera') config.set('Driver', 'opera_driver_path', '/tmp/driver') config_driver = ConfigDriver(config) config_driver._create_local_driver() webdriver_mock.Opera.assert_called_once_with(desired_capabilities=DesiredCapabilities.OPERA, executable_path='/tmp/driver')
Example #6
Source File: test_config_driver.py From toolium with Apache License 2.0 | 5 votes |
def test_create_remote_driver_opera(webdriver_mock, config): config.set('Driver', 'type', 'opera') server_url = 'http://10.20.30.40:5555' utils = mock.MagicMock() utils.get_server_url.return_value = server_url config_driver = ConfigDriver(config, utils) config_driver._create_remote_driver() capabilities = DesiredCapabilities.OPERA capabilities['opera.autostart'] = True capabilities['opera.arguments'] = '-fullscreen' webdriver_mock.Remote.assert_called_once_with(command_executor='%s/wd/hub' % server_url, desired_capabilities=capabilities)