TA的每日心情 | 奋斗 2017-1-12 14:41 |
---|
签到天数: 3 天 连续签到: 1 天 [LV.2]测试排长
|
#coding=utf-8
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium.common.exceptions import NoAlertPresentException
from selenium.webdriver.support.ui import WebDriverWait
import unittest, time, re
import HTMLTestRunner #引入HTMLTestRunner包,记录测试报告
import lvfunc
class test_networkmonitor_apinfo(unittest.TestCase):
__setupok = 0
def setUp(self):
self.__setupok = lvfunc.lvlogin(self)
def test_001(self):
try:
if self.__setupok == 1:
return
driver = self.driver
#点击管理进入相应的场所
driver.find_element_by_xpath("//a/span[contains(text(),'管理')]").click()
#判断当前页面是否存在设备概览
## WebDriverWait(driver, 10).until(lambda the_driver: the_driver.find_element_by_xpath("//a/span[contains(text(),'设备概览')]").is_displayed())
time.sleep(5)
#默认界面接口,确保当前页面时默认界面,网络监控——>设备概览
lvfunc.lvdefaultPage(driver) ——————————————————运行到这的时候,脚本就退出了,显示结果ok,实际上都没有运行完,
print 1111
driver.find_element_by_xpath("//a/span[contains(text(),'AP信息')]").click()
WebDriverWait(driver, 10).until(lambda the_driver: the_driver.find_element_by_xpath("//div/span[contains(text(),'AP数量')]").is_displayed())
time.sleep(6)
---------等等 |
|