珠峰网站建设,wordpress小程序编辑,房产行情最新信息,海南做网站的1、 研究自动化测试也有一段时间了#xff0c;从不熟悉到慢慢的了解#xff0c;从不会到会#xff0c;从迷茫到清晰...... 前段时间一直都很疑惑#xff0c;为什么要自动化#xff0c;自动化能给我们带来哪些好处#xff1f;它存在的价值在哪里#xff1f;运行一个脚本…1、 研究自动化测试也有一段时间了从不熟悉到慢慢的了解从不会到会从迷茫到清晰...... 前段时间一直都很疑惑为什么要自动化自动化能给我们带来哪些好处它存在的价值在哪里运行一个脚本执行的时候难道还要盯着电脑屏幕去关注脚本运行的情况吗那还不如手动的去点击呢 迷茫疑惑的时候建立多看看一些关于自动化测试的书籍看看别人项目采用自动化测试自动化测试给公司创造的价值 比如敏捷测试里面有几章是说自动化测试的 自动化测试指南 其他自动测试工具 ........ 2、从事测试行业也快一年了说长不长说短也不短可是自己规划自己的职业方向的时候感觉很迷茫不知自己以后的方向到底是咋样的自己是否真正的喜爱测试这个行业还是当初为了生存才进入这个行业的其实这跟我大学时的目标或者说理想有偏离了很多进入测试行业之后我开始了解功能测试学习编写测试用例的方法学习自动化工具学习JavaScript.....自己有时会很怀疑这是否就是自己想要的生活 以下Share下最近写的测试脚本吧 def nessouring(): chromedriverD:\Program Files (x86)\Chrome\chromedriver.exeos.environ[webdriver.chrome.driver] chromedriverbrowser webdriver.Chrome(chromedriver) # Get local session of firefoxbrowser.maximize_window()browser.get(http://192.168.1.20:9999) # Load pageassert login in browser.titlebrowser.implicitly_wait(2)Means.login(browser, 4pc.com, 123456) #登录pmtime.sleep(1)# Let the page load, will be added to the APIbrowser.find_element_by_xpath(//div[classpm tile double icon bg-color-redCustorm]/div/img).click() #using xpath to find elementtime.sleep(2)browser.find_element_by_xpath(//ul[idmenu]/li/a).click()#click sourcingtime.sleep(1)browser.find_element_by_id(btnSearchNew).click()rrandom.randint(1,1000)print rbrowser.find_element_by_id(LegalName).send_keys(r)browser.find_element_by_xpath(//div[identityType]/div).click()time.sleep(2)entitytypebrowser.find_element_by_xpath(//div[identityType]/div[2]/ul/li[3])print 输出entitytype:%s %(entitytype.text)entitytype.click() #drop list chosentime.sleep(2)browser.find_element_by_xpath(//div[idstateRegistered]/div).click()time.sleep(2)staterebrowser.find_element_by_xpath(//div[idstateRegistered]/div[2]/ul/li[7])statere.click() browser.find_element_by_xpath(//input[idOfficePhoneAreaCode]).send_keys(129)browser.find_element_by_xpath(//input[idOfficePhoneCentralOfficeCode]).send_keys(619)browser.find_element_by_xpath(//input[idOfficePhoneStationCode]).send_keys(1881)browser.find_element_by_xpath(//input[idContactOfficeAreaCode]).send_keys(545)browser.find_element_by_xpath(//input[idContactOfficeCentralOfficeCode]).send_keys(798)browser.find_element_by_xpath(//input[idContactOfficeStationCode]).send_keys(3363)browser.find_element_by_id(SearchButton).click()if r850 and entitytype.textCorporation and statere.textCalifornia(CA):alertsbrowser.find_element_by_id(alertSearch)print alert的提示信息是否为This affiliate already exists in the system ! --- %s %(alerts.text)browser.find_element_by_id(LegalName).send_keys(Simpleok!)time.sleep(1)browser.find_element_by_id(SearchButton).click()time.sleep(1)else:newbuttonbrowser.find_element_by_id(NewLeadButton)if newbutton.is_displayed():print newbutton显示出来了直接点击按钮New Lead即可time.sleep(1)browser.find_element_by_id(NewLeadButton).click()else:print存在相同的phone #或者是office #,需重新填写phone # 或者Office #,需重新填写browser.find_element_by_xpath(//input[idOfficePhoneAreaCode]).clear()time.sleep(1)browser.find_element_by_xpath(//input[idOfficePhoneAreaCode]).send_keys(829)browser.find_element_by_xpath(//input[idOfficePhoneCentralOfficeCode]).clear()browser.find_element_by_xpath(//input[idOfficePhoneCentralOfficeCode]).send_keys(739)browser.find_element_by_xpath(//input[idOfficePhoneStationCode]).clear()browser.find_element_by_xpath(//input[idOfficePhoneStationCode]).send_keys(1584)browser.find_element_by_xpath(//input[idContactOfficeAreaCode]).clear()browser.find_element_by_xpath(//input[idContactOfficeAreaCode]).send_keys(981)browser.find_element_by_id(SearchButton).click()time.sleep(1)browser.find_element_by_id(NewLeadButton).click()time.sleep(1) print 检查当前页面的URL:http://192.168.1.20:9999/affiliate/pm/sourcing_detail.html ! ---%s %(browser.current_url)browser.find_element_by_xpath(html/body/form/div[1]/div[1]/button[1]).click()save_alertbrowser.find_element_by_xpath(html/body/div[1])if save_alert.is_displayed():printsave_alert被显示了显示内容为Please fill out all mandatory fields!f --- %s %(save_alert.text)else:printsave_alert没有显示 此处有BUGtime.sleep(1)3、我是一个像空气一样自由的人妨碍我心灵自由的时候绝不妥协。轰轰烈烈的恋爱舍命的读书. 转载于:https://www.cnblogs.com/tyen0921/p/3556245.html