当前位置: 首页>>代码示例>>Python>>正文


Python DesiredCapabilities.INTERNETEXPLORER属性代码示例

本文整理汇总了Python中selenium.webdriver.common.desired_capabilities.DesiredCapabilities.INTERNETEXPLORER属性的典型用法代码示例。如果您正苦于以下问题:Python DesiredCapabilities.INTERNETEXPLORER属性的具体用法?Python DesiredCapabilities.INTERNETEXPLORER怎么用?Python DesiredCapabilities.INTERNETEXPLORER使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在selenium.webdriver.common.desired_capabilities.DesiredCapabilities的用法示例。


在下文中一共展示了DesiredCapabilities.INTERNETEXPLORER属性的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run_browserstack

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
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) 
开发者ID:qxf2,项目名称:makemework,代码行数:27,代码来源:DriverFactory.py

示例2: run_sauce_lab

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
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) 
开发者ID:qxf2,项目名称:makemework,代码行数:23,代码来源:DriverFactory.py

示例3: run_browserstack

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
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) 
开发者ID:qxf2,项目名称:qxf2-page-object-model,代码行数:27,代码来源:DriverFactory.py

示例4: run_sauce_lab

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
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) 
开发者ID:qxf2,项目名称:qxf2-page-object-model,代码行数:23,代码来源:DriverFactory.py

示例5: test_create_local_driver_iexplore

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def test_create_local_driver_iexplore(webdriver_mock, config):
    config.set('Driver', 'type', 'iexplore')
    config.set('Driver', 'explorer_driver_path', '/tmp/driver')
    config_driver = ConfigDriver(config)

    config_driver._create_local_driver()
    webdriver_mock.Ie.assert_called_once_with('/tmp/driver', capabilities=DesiredCapabilities.INTERNETEXPLORER) 
开发者ID:Telefonica,项目名称:toolium,代码行数:9,代码来源:test_config_driver.py

示例6: test_create_remote_driver_iexplore

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def test_create_remote_driver_iexplore(webdriver_mock, config):
    config.set('Driver', 'type', 'iexplore')
    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()
    webdriver_mock.Remote.assert_called_once_with(command_executor='%s/wd/hub' % server_url,
                                                  desired_capabilities=DesiredCapabilities.INTERNETEXPLORER) 
开发者ID:Telefonica,项目名称:toolium,代码行数:12,代码来源:test_config_driver.py

示例7: test_create_remote_driver_version_platform

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def test_create_remote_driver_version_platform(webdriver_mock, config):
    config.set('Driver', 'type', 'iexplore-11-on-WIN10')
    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.INTERNETEXPLORER
    capabilities['version'] = '11'
    capabilities['platform'] = 'WIN10'
    webdriver_mock.Remote.assert_called_once_with(command_executor='%s/wd/hub' % server_url,
                                                  desired_capabilities=capabilities) 
开发者ID:Telefonica,项目名称:toolium,代码行数:15,代码来源:test_config_driver.py

示例8: test_create_remote_driver_version

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def test_create_remote_driver_version(webdriver_mock, config):
    config.set('Driver', 'type', 'iexplore-11')
    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.INTERNETEXPLORER.copy()
    capabilities['version'] = '11'
    webdriver_mock.Remote.assert_called_once_with(command_executor='%s/wd/hub' % server_url,
                                                  desired_capabilities=capabilities) 
开发者ID:Telefonica,项目名称:toolium,代码行数:14,代码来源:test_config_driver.py

示例9: test_create_remote_driver_capabilities

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def test_create_remote_driver_capabilities(webdriver_mock, config):
    config.set('Driver', 'type', 'iexplore-11')
    config.add_section('Capabilities')
    config.set('Capabilities', 'version', '11')
    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.INTERNETEXPLORER.copy()
    capabilities['version'] = '11'
    webdriver_mock.Remote.assert_called_once_with(command_executor='%s/wd/hub' % server_url,
                                                  desired_capabilities=capabilities) 
开发者ID:Telefonica,项目名称:toolium,代码行数:16,代码来源:test_config_driver.py

示例10: start

# 需要导入模块: from selenium.webdriver.common.desired_capabilities import DesiredCapabilities [as 别名]
# 或者: from selenium.webdriver.common.desired_capabilities.DesiredCapabilities import INTERNETEXPLORER [as 别名]
def start(self, **kwargs):
        '''
        get root ready
        like get root element in windows UIA, get browser to target website

        must have a "browser_name" argument in kwargs to indicate which browser to use
        other kwargs are same as normal selenium webdrivers
        '''
        if not "browser_name" in kwargs:
            LOGGER.error("Browser name not specified")
            raise DriverException("Browser name not specified")

        browser_name = kwargs["browser_name"]
        if not browser_name.upper() in self.support_browsers:
            LOGGER.error("Unsupported browser name: %s" , browser_name)
            raise DriverException("Unsupported browser name: %s" % browser_name)

        #remove browser_name key from kwargs
        del kwargs["browser_name"]

        #for ie browser, need to ignore zoom settings
        if browser_name.upper() == "IE":
            if "capabilities" in kwargs:
                #insert "ignoreZoomSetting" in driver capabilities
                caps = kwargs["capabilities"]
                caps["ignoreZoomSetting"] = True
            else:
                #add default capabilities
                caps = DesiredCapabilities.INTERNETEXPLORER
                caps["ignoreZoomSetting"] = True
                kwargs["capabilities"] = caps

        self.webdriver = self.support_browsers[browser_name.upper()](**kwargs) 
开发者ID:xcgspring,项目名称:AXUI,代码行数:35,代码来源:UIElement.py


注:本文中的selenium.webdriver.common.desired_capabilities.DesiredCapabilities.INTERNETEXPLORER属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。