Exemplo n.º 1
0
def change_dhcp(self):
    try:
        driver = self.driver
        #协议选择dhcp
        wan_control.set_wan_protrocol(self,'dhcp')
        #点击切换协议
        wan_control.set_wan_switchprotocol(self)
        driver.implicitly_wait(10)
        #点击保存应用
        wan_control.apply(self)
        time.sleep(60)
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为DHCP的过程失败,原因如下:\n%s"%e
Exemplo n.º 2
0
def change_pppoe(self,username,password):
    try:
        driver = self.driver
        driver.implicitly_wait(10)
        #协议选择pppoe
        wan_control.set_wan_protrocol(self,'pppoe')
        #点击切换协议
        wan_control.set_wan_switchprotocol(self)
        driver.implicitly_wait(10)
        wan_control.set_wan_pppoe_userpwd(self,username,password)
        #点击保存应用
        wan_control.apply(self)
        time.sleep(60)
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为pppoe的过程失败,原因如下:\n%s"%e
Exemplo n.º 3
0
def change_staticip(self,ip,gw,dns):
    try:
        driver = self.driver
        #协议选择staticip
        wan_control.set_wan_protrocol(self,'staticip')
        #点击切换协议
        wan_control.set_wan_switchprotocol(self)
        driver.implicitly_wait(10)
        #输入wan ip
        wan_control.set_wan_staticip_ip(self,ip)
        #选择C类掩码
        wan_control.set_wan_staticip_netmask(self,'C')
        #输入wan 网关
        wan_control.set_wan_staticip_gateway(self,gw)
        #输入DNS
        wan_control.set_wan_staticip_dns(self,dns)
        wan_control.apply(self)
        time.sleep(60)
    #捕捉异常并打印异常信息
    except Exception,e:
        print u"把路由WAN口改为static ip的过程失败,原因如下:\n%s"%e