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


Python BuiltIn.unselect_checkbox方法代码示例

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


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

示例1: _BrowserManagementKeywords

# 需要导入模块: from robot.libraries.BuiltIn import BuiltIn [as 别名]
# 或者: from robot.libraries.BuiltIn.BuiltIn import unselect_checkbox [as 别名]

#.........这里部分代码省略.........
            token = (':'.join([username, access_key])).encode('base64').strip()
            payload = { 'name': suite_name,
                        'passed': suite_status == 'PASS',
                        'tags': tags}
            headers = {'Authorization': 'Basic {0}'.format(token)}
            url = 'https://saucelabs.com/rest/v1/{0}/jobs/{1}'.format(username, self._job_id)
            response = requests.put(url, data=json.dumps(payload), headers=headers)
            assert response.status_code == 200, response.text
            # video_url = json.loads(response.text).get('video_url')
            # if video_url:
                # logger.info('<a href="{0}">video.flv</a>'.format(video_url), html=True)
            ondemand_string = "SauceOnDemandSessionID=%s job-name=%s" % (self._job_id, suite_name)
            print 'setting ONDEMAND_PYRO to : %s' % ondemand_string    
            os.environ['ONDEMAND_PYRO'] = ondemand_string
            #wrapper = Wrapper(self._seleniumlib, username, access_key, sys.argv[2])
            #wrapper.update_sauce_rest(BuiltIn().get_variable_value("${SUITE STATUS}"), BuiltIn().get_variable_value("${TEST_TAGS}"))
        
        self._seleniumlib.close_browser
        self._seleniumlib.close_all_browsers
        print 'CLOSE BROWSER TIME!!'

    def selenium_drag_and_drop(self, locator_type, ele_source, ele_dest):
        self._seleniumlib.drag_and_drop('%s=%s' % (locator_type,ele_source), '%s=%s' % (locator_type,ele_dest))

    def selenium_drag_and_drop_actions(self, locator_type, ele_source, ele_dest):
        self._seleniumlib.mouse_down('%s=%s' % (locator_type,ele_source))
        self._seleniumlib.mouse_over('%s=%s' % (locator_type,ele_dest))
        self._seleniumlib.mouse_up('%s=%s' % (locator_type,ele_dest))

    def selenium_check(self, locator_type, element_locator):
        self._seleniumlib.select_checkbox('%s=%s' % (locator_type,element_locator))
  
    def selenium_uncheck(self, locator_type, element_locator):
        self._seleniumlib.unselect_checkbox('%s=%s' % (locator_type,element_locator))
    
    def selenium_wait_until_element_is_visible(self, locator_type, element_locator, _timeout=5):
        self._seleniumlib.wait_until_element_is_visible('%s=%s' % (locator_type,element_locator), timeout=_timeout)
    
    def selenium_wait_for_element_present(self, locator_type, element_locator):
        self._seleniumlib.wait_until_page_contains_element('%s=%s' % (locator_type,element_locator))
    
    def selenium_verify_text_from_element(self, locator_type, element_locator, text):
        self._seleniumlib.element_text_should_be('%s=%s' % (locator_type,element_locator), text)
    
    def selenium_reload(self, suspend_after_element_found='createUser_wiz'):
        """Refreshes the browser, which is effectively like the user pressed F5.
        Optional, supply the suspend_after_element_found with an element to find after reloading and apply the following javascript:
           window.ADTRAN.store.RefreshBaseStore.suspendAll();
           window.ADTRAN.util.SysPollTask.suspend();
        Note: Setting this to equal None will disable the javascript and wait for element functionality entirely
        """        
        print '(selenium_reload) suspend = %s' % suspend_after_element_found
        self._seleniumlib.reload_page()
        if type(suspend_after_element_found) == type(''):
            print '(selenium_reload) javascript suspendAll issued! (suspend_after_element_found == %s' % suspend_after_element_found
            self._seleniumlib.wait_until_element_is_visible(suspend_after_element_found, error='(selenium_reload) failed because the element was not found after reload')
            self._seleniumlib.execute_javascript('window.ADTRAN.store.RefreshBaseStore.suspendAll();')
            self._seleniumlib.execute_javascript('window.ADTRAN.util.SysPollTask.suspend();')
            
    def selenium_type(self, locator_type, element_locator, text):
        self._seleniumlib.input_text('%s=%s' % (locator_type,element_locator), text)
    
    def selenium_clear(self, locator_type, element_locator):
        self._seleniumlib.input_text('%s=%s' % (locator_type,element_locator), '')
        
    def selenium_verify_attribute_from_element(self, locator_type, element_locator, element_class_locator, text):
开发者ID:Tallisado,项目名称:pyrolibrary,代码行数:70,代码来源:_browsermanagement.py


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