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


Python WebUI.move_scroll_to_element_use_px方法代码示例

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


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

示例1: mac_filter_configuration

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import move_scroll_to_element_use_px [as 别名]
def mac_filter_configuration():
    wui = WebUI()
    config = Configuration(wui.d("visit.url"), wui.d("visit.title"))
    if wui.session_id:
        config.to_page_before_deployed_ssid()
        ssidname=wui.d("ssid.name")
        config.input_ssid_name(ssidname, ssidname)
        config.ssid_usage_settings('CUSTOM')

        #select to security method as wpa psk  
        psk_key="aerohive"      
        wui.info('will move scroll to access security...', True)
        wui.move_scroll_to_element(DeployedSSID.get('access_div'))
        wui.wait_until_element_displayed(DeployedSSID.get('psk_access_label'))
        wui.click(DeployedSSID.get('psk_access_span'))
        wui.wait_until_element_displayed(DeployedSSID.get('psk_key_value'))
        wui.input(DeployedSSID.get('psk_key_value'), psk_key)
        wui.wait_until_element_displayed(DeployedSSID.get('psk_confirm_value'))
        wui.input(DeployedSSID.get('psk_confirm_value'), psk_key)
        
        #select cwp tab to config cwp
        cwp_name = wui.d("ssid.cwp_name")
        wui.info('try to click captive web portal tab to enable cwp', True)
        wui.move_scroll_to_element_use_px(CWPConfig.get('ssid_tab'))
        wui.click(CWPConfig.get('cwp_tab'))
        wui.wait_until_element_displayed(CWPConfig.get('cwp_enable_switch'))
        wui.info('go to  cwp configuration section successfully...', True)
        #enable cwp switch
        wui.check(CWPConfig.get('cwp_enable_switch'))
        wui.info('enable cwp successfull....', True)
        
        #config cwp web directory name
        wui.info('try to move element to cwp name input line....', True)
        wui.move_scroll_to_element(CWPConfig.get('cwp_name_input_element'))
        wui.input(CWPConfig.get('cwp_to_use_input'),cwp_name)
        time.sleep(1)
        wui.info('input cwp name successfully', True)
        
        wui.info('try to click the save button to save the cwp object', True)
        wui.click(CWPConfig.get('cwp_to_use_save'))
        wui.wait_until_element_displayed(CWPConfig.get('new_cwp_title'))
        time.sleep(1)
        wui.info('go to new cwp page success...', True)
        
        wui.wait_until_element_displayed(CWPConfig.get('cwp_name'))
        wui.click(CWPConfig.get('new_cwp_save'))
        time.sleep(2)
        wui.info('try to move scroll to cwp section', True)
        wui.move_scroll_to_element(CWPConfig.get('cwp_name_input_element'))
        wui.info('create cwp successfully', True)
        
        # save the ssid level configuration
        wui.click(CWPConfig.get('new_ssid_save'))
        wui.wait_until_element_displayed(CWPConfig.get('new_ssid_success'))
        time.sleep(1)
        wui.info('Save ssid successfully', True)
        
        #go to deploy page, and push config
        wui.click(monitor_cfg.Deploy_policy_button)
        time.sleep(2)
        wui.info( 'go to deploy policy page success' , True )
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:63,代码来源:cwp_config.py

示例2: mac_filter_configuration

# 需要导入模块: from webui import WebUI [as 别名]
# 或者: from webui.WebUI import move_scroll_to_element_use_px [as 别名]
def mac_filter_configuration():
    wui = WebUI()
    config = Configuration(wui.d("visit.url"), wui.d("visit.title"))
    if wui.session_id:
        config.to_url_home()
        config.to_menu(wui.d("policy.menu_name"))
        config.wait_until_to_menu_success(wui.d("policy.menu_name"))
        config.to_page_before_policy()
        config.create_network_policy(wui.d("policy.name"), wui.d("policy.Description"))
        wui.wait_until_element_displayed(SelectSSIDPage.get('new_btn'))
        wui.info('Get to SSID select page', True)
        wui.click(SelectSSIDPage.get('new_btn'))  
        #input ssid name
        ssidname=wui.d("ssid.name")
        wui.wait_until_element_displayed(ConfigSSIDPage.get('ssidname_input'))
        wui.info('Get to SSID configure page', True)
        wui.input(ConfigSSIDPage.get('ssidname_input'), ssidname)
        wui.clear(ConfigSSIDPage.get('ssidbroadname_input'))
        wui.input(ConfigSSIDPage.get('ssidbroadname_input'), ssidname)
        wui.info('Input SSID name successfully', True)
                
        #select customer checkbox
        wui.wait_until_element_displayed(DeployedSSID.get('custom_display'))
        wui.click(DeployedSSID.get('custom_span'))
        time.sleep(1)
        wui.info('Select custom option successfully', True)
        
        #select open auth checkbox
        wui.info("Enter to Open mode")
        wui.info('will move scroll to next access security section', True)
        wui.move_scroll_to_element(DeployedSSID.get('access_div'))
        wui.wait_until_element_displayed(DeployedSSID.get('open_access_label'))
        wui.click(DeployedSSID.get('open_access_span'))
        wui.info('Config open successfully', True)
        
        #check optional setting section for mac filter is displayed
        wui.info('will move scroll to bottom page', True)
        wui.move_scroll_bottom()
        wui.wait_until_element_displayed(MacFilter.get('optional_setting_desc_xpath'))
        
        #optional setting page title diplay
        wui.info('Try to click customize button to go to config page', True)
        wui.click(MacFilter.get('opt_customize_btn'))
        wui.info('go to optional setting config page successfully', True)
        
        #go to mac filter config sections
        #enable mac-filter function
        wui.click(MacFilter.get('mac_filter_checkbox'))
        wui.info('mac filter is enabled!', True)
        
        #check the default action is Permit
        global_default_action = "Permit"
        new_global_default_action = wui.find_element(MacFilter.get('mac_filter_default_action')).text
        if global_default_action == new_global_default_action:
            wui.info('the global default action is Permit, it is correct for default setting', True)
        else:
            wui.error('The default action is incorrect!', True)
            
        #click new to add an mac filter entry, for exmaple for apples devices
        wui.info('Try to move to add new mac filter entry section', True)
        wui.move_scroll_to_element_use_px(MacFilter.get('mac_filter_section'))
        wui.info('move to mac filter config section success', True)
        wui.click(MacFilter.get('mac_filter_entry_new_btn'))
        wui.wait_until_element_displayed(MacFilter.get('mac_filter_newentry_input_mac'))
        wui.info('the new mac filter section display success!', True)
        #select apple devices oui
        wui.click(MacFilter.get('mac_filter_newentry_select_mac_btn'))
        wui.wait_until_element_displayed(MacFilter.get('mac_entry_oui_apple'))
        wui.info('can show the mac list success!', True)
        wui.click(MacFilter.get('mac_entry_oui_apple'))
        wui.info('select the apple devices oui success!', True)
        #select the mac entry action as deny
        wui.click(MacFilter.get('mac_entry_action_btn'))
        wui.info('click the dropdown box success!', True)
        tmp_mac_entry_action=wui.find_element(MacFilter.get('mac_entry_action_deny')).text
        selected_mac_entry_action = tmp_mac_entry_action.upper()
        wui.click(MacFilter.get('mac_entry_action_deny'))
        wui.info('select the deny action success!', True)
        #add the mac entry
        wui.click(MacFilter.get('mac_entry_add_btn'))
        wui.info('add the mac entry success!', True)
        
        # click save button to save the config about optional settings
        
        new_mac_entry_oui = wui.find_element(MacFilter.get('added_mac_entry_oui_name')).text
        new_mac_entry_action = wui.find_element(MacFilter.get('added_mac_entry_action')).text


        if (new_mac_entry_oui == "Apple-iPhone") and (new_mac_entry_action == selected_mac_entry_action):
            wui.info('mac filter object is correct....', True)
        else:
            wui.error('mac-filter object is incorrect....', True)
            
        wui.click(MacFilter.get('optional_setting_save_btn'))
        
        # save the ssid level configuration
        wui.click(MacFilter.get('ssid_saved_btn'))
        wui.wait_until_element_displayed(MacFilter.get('ssid_saved_success'))
        wui.info('Save ssid successfully', True)
        
#.........这里部分代码省略.........
开发者ID:gvsurenderreddy,项目名称:AerohiveAuto,代码行数:103,代码来源:mac_filter_config.py


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