def modify_sorcing(): lo = login_init.loginpage() so = Sourcing_init.sourcing() det = Pm_affiliateDetail.affiliatedetail() chromedriver = "D:\Program Files (x86)\Chrome\chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver browser = webdriver.Chrome(chromedriver) # Get local session of firefox browser.maximize_window() browser.get("http://192.168.1.20:9999") # Load page assert "login" in browser.title browser.implicitly_wait(2) Means.login(browser, "*****@*****.**", "123456") assert "System Integration" in browser.title lo.rolechosered(browser).click() time.sleep(2) so.sour(browser).click() time.sleep(1) status = so.tabstatus(browser).text if status == "Converted": print "此sourcing的状态为Converted,其详情页面不能编辑!" browser.quit() # 不能编辑,退出脚本 else: so.tableone(browser).click() le = det.LegalName(browser).text #############修改Legal Name字段################ det.LegalName(browser).clear() det.LegalName(browser).send_keys("modifyitsname01") name = det.LegalName(browser).text det.sosave(browser).click() #############确认是否修改成功###################### if le == name: print (le + "更改成了:modifyitsname" + ",此处没有Bug,成功修改!") testlog.logsys("此处没有BUG", "---没有BUG") else: print (le + "没有被修改,此处有BUG,请开发人员修改!---BUG") # 此处要是能做成那种发现bug,自动发送邮件给开发人员就Perfect了! browser.get_screenshot_as_file("D:/svn_QA/Screeshot/modifysourname.jpg") emailimage.AutoSendMail( u"修改sourcing页面的legal Name---此处有BUG,且附件是发送异常时的截图!请参考。" + "\n" + "感谢指导", "D:\\svn_QA\Screeshot\modifysourname.jpg", ) browser.close()
def sourcing_search(): a=['*****@*****.**','*****@*****.**','*****@*****.**'] Uname=["$%^&&&","45611%^","dad&^"] lo=login_init.loginpage() so=Sourcing_init.sourcing() Un=Pm_affiliate_search.affiliatesearch() chromedriver="D:\Program Files (x86)\Chrome\chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver browser = webdriver.Chrome(chromedriver) # Get local session of firefox browser.maximize_window() browser.get("http://192.168.1.20:9999") # Load page assert "login" in browser.title browser.implicitly_wait(2) Means.login(browser, '*****@*****.**', '123456') assert "System Integration" in browser.title lo.rolechosered(browser).click() time.sleep(2) so.sour(browser).click() time.sleep(1) Un.affiliateSearchfunction(browser).click() Un.Searchaffiliatename(browser).send_keys("@#$^&*^") time.sleep(1) Un.searchbutton(browser).click() ndata=Un.shownodata(browser).text if ndata=="No Data": print "输入特殊字符@¥@¥¥,返回值为No Data,此处没有BUG" Result_te.rest("输入特殊字符@¥@¥¥,返回值为No Data,此处没有BUG") else: print"输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG" browser.get_screenshot_as_file("D:/svn_QA/Screeshot/sourcingsearch.jpg") # Sendemail.send_mail(a,'ting Auto test',u'输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG') emailimage.AutoSendMail(u"输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG,且附件是发送异常时的截图!请参考。"+"\n"+"感谢指导","D:\\svn_QA\Screeshot\sourcingsearch.jpg") testlog.logsys("输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG", "---有BUG") Result_te.rest("输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG") browser.close() #sourcing_search()
def newaffiliate(self): getrole = login_init.loginpage() getaffiliate = Pm_affiliate_search.affiliatesearch() affiliatedetail = Pm_affiliateDetail.affiliatedetail() chromedriver = "D:\Program Files (x86)\Chrome\chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver browser = webdriver.Chrome(chromedriver) # Get local session of firefox browser.maximize_window() try: browser.get("http://192.168.1.20:9999") # Load page assert "login" in browser.title browser.implicitly_wait(2) Means.login(browser, "*****@*****.**", "123456") assert "System Integration" in browser.title getrole.rolechosecm(browser).click() assert "http://192.168.1.20:9999/affiliate/cm/dashboard_index.html" in browser.current_url getaffiliate.affiliatesearchlist(browser).click() assert "Affiliate List" in browser.title time.sleep(1) getaffiliate.affiliateNew(browser).click() assert "http://192.168.1.20:9999/affiliate/CommonPages/affiliate_create.html" in browser.current_url affiliatedetail.LegalName(browser).send_keys("element test") affiliatedetail.DBAname(browser).send_keys("DBA Name") affiliatedetail.EntityType(browser).click() time.sleep(1) affiliatedetail.EntityTypeLLP(browser).click() assert "LLP" in affiliatedetail.EntityTypeLLP(browser).text affiliatedetail.State(browser).click() time.sleep(1) affiliatedetail.StateAS(browser).click() except Exception as e: print e msg = traceback.format_exc() testlog.logsys("运行失败", "控件没找到!" + msg) browser.close()
def nessouring(): chromedriver="D:\Program Files (x86)\Chrome\chromedriver.exe" os.environ["webdriver.chrome.driver"] = chromedriver browser = webdriver.Chrome(chromedriver) # Get local session of firefox browser.maximize_window() browser.get("http://192.168.1.20:9999") # Load page assert "login" in browser.title browser.implicitly_wait(2) Means.login(browser, '*****@*****.**', '123456') #登录pm time.sleep(2)# Let the page load, will be added to the API try: browser.find_element_by_xpath("//div[@class='pm tile double icon bg-color-redCustorm']/div/img").click() #using xpath to find element time.sleep(2) browser.find_element_by_xpath("//ul[@id='menu']/li/a").click()#click sourcing time.sleep(1) browser.find_element_by_id("btnSearchNew").click() # r=random.randint(1,1000) # print r browser.find_element_by_id("LegalName").send_keys(test.name[2]) browser.find_element_by_xpath("//div[@id='entityType']/div").click() time.sleep(2) entitytype=browser.find_element_by_xpath("//div[@id='entityType']/div[2]/ul/li[3]") print "输出entitytype:%s" %(entitytype.text) entitytype.click() #drop list chosen time.sleep(2) browser.find_element_by_xpath("//div[@id='stateRegistered']/div").click() time.sleep(2) statere=browser.find_element_by_xpath("//div[@id='stateRegistered']/div[2]/ul/li[7]") statere.click() browser.find_element_by_xpath("//input[@id='OfficePhoneAreaCode']").send_keys(test.times[1]) browser.find_element_by_xpath("//input[@id='OfficePhoneCentralOfficeCode']").send_keys(test.times[2]) browser.find_element_by_xpath("//input[@id='OfficePhoneStationCode']").send_keys("1881") browser.find_element_by_xpath("//input[@id='ContactOfficeAreaCode']").send_keys("545") browser.find_element_by_xpath("//input[@id='ContactOfficeCentralOfficeCode']").send_keys(test.times[1]) browser.find_element_by_xpath("//input[@id='ContactOfficeStationCode']").send_keys("3363") browser.find_element_by_id("SearchButton").click() if test.name[2]=='test01' and entitytype.text=='Corporation' and statere.text=='California(CA)': alerts=browser.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: newbutton=browser.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[@id='OfficePhoneAreaCode']").clear() time.sleep(1) browser.find_element_by_xpath("//input[@id='OfficePhoneAreaCode']").send_keys('829') browser.find_element_by_xpath("//input[@id='OfficePhoneCentralOfficeCode']").clear() browser.find_element_by_xpath("//input[@id='OfficePhoneCentralOfficeCode']").send_keys("739") browser.find_element_by_xpath("//input[@id='OfficePhoneStationCode']").clear() browser.find_element_by_xpath("//input[@id='OfficePhoneStationCode']").send_keys("1584") browser.find_element_by_xpath("//input[@id='ContactOfficeAreaCode']").clear() browser.find_element_by_xpath("//input[@id='ContactOfficeAreaCode']").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_alert=browser.find_element_by_xpath("html/body/div[1]") if save_alert.is_displayed(): print"save_alert被显示了!显示内容为:Please fill out all mandatory fields!f --- %s "%(save_alert.text) else: print"save_alert没有显示!! <此处有BUG>" time.sleep(1) browser.find_element_by_id("DBAName").send_keys("dba") time.sleep(1) browser.find_element_by_id("Address_AddressLine1").send_keys("line1") browser.find_element_by_id("Address_City").send_keys("city") browser.find_element_by_xpath("//div[@id='Address_State']/div").click() time.sleep(2) browser.find_element_by_xpath("//div[@id='Address_State']/div[2]/ul/li[3]").click() browser.find_element_by_id("Address_Zipcode").send_keys("12345") browser.find_element_by_id("Address_Country").send_keys("USA") browser.find_element_by_id("copyAddress").click() time.sleep(1) browser.find_element_by_xpath("//div[@id='ContactList']/div/div[2]/ul/li/div/input").send_keys("liui") browser.find_element_by_xpath("//div[@id='ContactList']/div/div[2]/ul[2]/li/div/input").send_keys("lting") browser.implicitly_wait(2) browser.find_element_by_xpath("//div[@id='ContactList']/div/div[2]/ul[2]/li[3]/div/input[2]").send_keys("123") browser.find_element_by_xpath("//div[@id='ContactList']/div/div[2]/ul[2]/li[3]/div/input[3]").send_keys("183") browser.find_element_by_xpath("//div[@id='ContactList']/div/div[2]/ul[2]/li[3]/div/input[4]").send_keys("1239") time.sleep(1) browser.find_element_by_id("MBECertified_CheckApplicable").click() browser.find_element_by_id("SelfPerformingCrews").send_keys("4") browser.find_element_by_id("SubContractedCrews").send_keys("4") #browser.find_element_by_xpath("//div[@id='ServiceTypes']/div").click browser.find_element_by_xpath("//ul[@id='Services']/li/div/p/span").click() time.sleep(1) browser.find_element_by_id("btnAddService").click() time.sleep(1) services=browser.find_element_by_xpath("//div[@id='ServiceAreas']/div/div/p") if services.text=='Repair & Maintenance': print"选择的服务类型正确:Repair & Maintenance ---%s" %(services.text) browser.find_element_by_xpath("//div[@id='ServiceAreas']/div/div/a").click() time.sleep(1) browser.find_element_by_xpath("html/body/div[8]/div[3]/div/button[1]").click() ServiceArea=browser.find_element_by_id("ServiceTypeError") if ServiceArea.text=='At least one service type needs to be selected.': print"删除服务范围之后,应有提示语:%s ,显示正确;" %(ServiceArea.text) else: print"在没有选择任何服务区域的时候,应有提示信息显示:At least one service type needs to be selected.---此处有BUG!" else: print "应显示服务类型的名字:Repair & Maintenance---此处有BUG!" browser.find_element_by_xpath("//ul[@id='Services']/li/div/p/span").click() time.sleep(1) browser.find_element_by_id("btnAddService").click() browser.implicitly_wait(2) browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[2]/ul/li/input").send_keys("12345") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[2]/ul/li[2]/input").send_keys("12") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[2]/ul/li[3]/input").send_keys("12") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[2]/ul/li[4]/input").send_keys("12") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[3]/ul/li[1]/input").send_keys("2") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[3]/ul/li[2]/input").send_keys("1") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[3]/ul/li[3]/input").send_keys("12") browser.find_element_by_xpath("//div[@id='ServiceAreas']/div[1]/div[2]/div[1]/div[3]/ul/li[4]/input").send_keys("12") time.sleep(1) browser.find_element_by_xpath("//body/form/div[1]/div[6]/button").click() time.sleep(1) browser.find_element_by_xpath("//body/form/div[1]/div/button[2]").click() time.sleep(2) browser.find_element_by_xpath("//html/body/div[8]/div[3]/div/button[1]").click() #browser.close() # except : # testlog.logsys("运行失败", "控件没找到!") except Exception as e: print e msg = traceback.format_exc() testlog.logsys("运行失败", "控件没找到!"+ msg) browser.get_screenshot_as_file("D:/svn_QA/Screeshot/NewSourcing.jpg") # Sendemail.send_mail(a,'ting Auto test',u'输入特殊字符@#¥¥,返回值应为No Data!---此处有BUG') emailimage.AutoSendMail(u"新增sourcing时失败!---此处有BUG,且附件是发送异常时的截图!请参考。"+"\n"+"感谢指导!","D:\\svn_QA\Screeshot\NewSourcing.jpg")
def test_AffiliateLink(self): browser = self.driver browser.get(self.base_url) browser.maximize_window() Means.login(browser, '*****@*****.**', '123456') WebDriverWait(browser, 5).until(lambda the_driver: browser.find_element_by_link_text("Dashboard").is_displayed()) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("//html/body/div[2]/div[1]/div[1]/div[2]/table/tbody/tr[1]/td[1]/a").click() print"检查页面是否跳转到:http://192.168.1.20:9999/affiliate/cm/dashboard_contract_request_assign.html" url='http://192.168.1.20:9999/affiliate/cm/dashboard_contract_request_assign.html' url2=browser.current_url if url==url2: print"跳转的页面正确:http://192.168.1.20:9999/affiliate/cm/dashboard_contract_request_assign.html" time.sleep(2) browser.find_element_by_link_text("Dashboard").click() time.sleep(2) browser.find_element_by_xpath("html/body/div[2]/div[1]/div[1]/div[2]/table/tbody/tr[2]/td[1]/a").click() url_contractre='http://192.168.1.20:9999/affiliate/CMAndCA/dashboard_request_list.html' url2_contractre=browser.current_url if url_contractre==url2_contractre: print"跳转正确:http://192.168.1.20:9999/affiliate/CMAndCA/dashboard_request_list.html" else: print"点击contractrequest链接,页面跳转错误!---<BUG1>" time.sleep(1) da=browser.find_element_by_link_text("Dashboard") print "点击的是dashboard页面 : %s" %(da.text) da.click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[1]/div[2]/table/tbody/tr[3]/td[1]/a").click() time.sleep(1) exceptionurl='http://192.168.1.20:9999/affiliate/CMAndCA/dashboard_exception_list.html' if exceptionurl==browser.current_url: print"点击dashboard页面中的excepiont之后,页面跳转正确!" else: print"点击dashboard页面中的exception链接之后,跳转页面错误!---<BUG2>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[1]/div[2]/table/tbody/tr[4]/td[1]/a").click() followupcontracturl="http://192.168.1.20:9999/affiliate/CMAndCA/dashboard_contract_follow_up_list.html" if followupcontracturl==browser.current_url: print"点击dashboard页面中的followupcontract链接,页面跳转正确!" else: print"点击dashboard页面中的followupcontract链接,页面跳转错误!---<BUG3>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[3]/div[2]/table/tbody/tr[1]/td[1]/a").click() insurance30daysurl="http://192.168.1.20:9999/affiliate/cmandca/report_current_insurance.html?date=0" if insurance30daysurl==browser.current_url: print"点击dashboard页面中的insuranceexpiring=30days链接,页面跳转正确!" else: print"点击dashboard页面中的insuranceexpirin=30days链接,页面跳转错误!---<BUG4>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[3]/div[2]/table/tbody/tr[2]/td[1]/a").click() insurance60daysurl="http://192.168.1.20:9999/affiliate/cmandca/report_current_insurance.html?date=1" if insurance60daysurl==browser.current_url: print"点击dashboard页面中的insuranceexpiring=60days链接,页面跳转正确!" else: print"点击dashboard页面中的insuranceexpiring=60days链接,页面跳转错误!---<BUG5>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[3]/div[2]/table/tbody/tr[3]/td[1]/a").click() insurance90daysurl="http://192.168.1.20:9999/affiliate/cmandca/report_current_insurance.html?date=2" if insurance90daysurl==browser.current_url: print"点击dashboard页面中的insuranceexpirting=90days链接,页面跳转正确!" else: print"点击dashboard页面中的insuranceexpirting=90days链接,页面跳转错误!---<BUG6>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[3]/div[2]/table/tbody/tr[4]/td[1]/a").click() time.sleep(1) insuranceexpiredurl="http://192.168.1.20:9999/affiliate/cmandca/report_current_insurance.html?date=3" if insuranceexpiredurl==browser.current_url: print"点击dashboard页面中的insuranceexpiration=expired链接,页面跳转正确!" else: print"点击dashboard页面中的insuranceexpiration=expired链接,页面跳转错误!---<BUG7>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[2]/div[1]/div[2]/a").click() time.sleep(1) caworkloadsummaryurl="http://192.168.1.20:9999/affiliate/cmandca/report_current_ca.html" if caworkloadsummaryurl==browser.current_url: print"点击dashboard页面中caworkload中的More按钮,页面跳转正确!" else: print"点击dashboard页面中caworkload中的More按钮,页面跳转错误!---<BUG8>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[4]/div[1]/div[2]/a").click() time.sleep(1) Contractcompliancestatusurl="http://192.168.1.20:9999/affiliate/cmandca/report_active_contract.html" if Contractcompliancestatusurl==browser.current_url: print"点击dashboard页面中的contract compliance status中的More按钮,页面跳转正确!" else: print"点击dashboard页面中的contract compliance status中的More按钮,页面跳转错误!---<BUG9>" time.sleep(1) browser.find_element_by_link_text("Dashboard").click() browser.find_element_by_xpath("html/body/div[2]/div[1]/div[5]/div[1]/div[2]/a").click() time.sleep(1) affiliatestatussummary="http://192.168.1.20:9999/affiliate/cmandca/report_affiliate_status.html" if affiliatestatussummary==browser.current_url: print"点击dashboard页面中的affiliate status summary中的More按钮,页面跳转正确!" else: print"点击dashboard页面中的affiliate status summary中的More按钮,页面跳转错误!---<BUG10>" time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[2]/a").click() time.sleep(1) affiliatesearch="http://192.168.1.20:9999/affiliate/CommonPages/affiliate_list.html" if affiliatesearch==browser.current_url: print"点击顶部导航的affiliate search,页面跳转正确!" else: print"点击顶部导航的affiliate search,页面跳转错误!---<BUG11>" time.sleep(1) time.sleep(1) browser.find_element_by_xpath("//table[@id='grid']/tbody/tr[1]/td[2]/div").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='subMenu']/li[2]/a").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='subMenu']/li[3]/a").click() time.sleep(1) time.sleep(1) browser.find_element_by_xpath("//ul[@id='subMenu']/li[4]/a").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[3]/a").click() time.sleep(1) Claimurl="http://192.168.1.20:9999/affiliate/cm/claim_list.html" if Claimurl==browser.current_url: print"点击顶部导航的的Claim,页面跳转正确!" else: print"点击顶部导航的Claim,页面跳转错误!---<BUG12>" browser.find_element_by_id("btnNew").click() time.sleep(1) NewClaimurl="http://192.168.1.20:9999/affiliate/cm/claim_detail.html" if NewClaimurl==browser.current_url: print"点击New,页面进入到New claim页面,页面跳转正确!" else: print"点击New,页面没有进入New claim页面,页面跳转错误!---<BUG14>" browser.find_element_by_id("btnCancel").click() time.sleep(1) browser.find_element_by_xpath("//div[@id='grid']/tbody/tr[1]/td[1]/div").click() time.sleep(1) browser.find_element_by_id("btnCancel").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[4]/a").click() time.sleep(1) Contracturl="http://192.168.1.20:9999/affiliate/CMAndCA/contract_compliance_status_list.html" if Contracturl==browser.current_url: print"点击顶部导航的Contract,页面跳转正确!" else: print"点击顶部导航的Contract,页面跳转错误!---<BUG13>" time.sleep(1) browser.find_element_by_id("btnException").click() time.sleep(1) browser.find_element_by_id("btnAll").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[5]/a").click() time.sleep(1) contractrequesturl="http://192.168.1.20:9999/affiliate/cmandca/request_list.html" if contractrequesturl==browser.current_url: print"点击顶部导航的Contract Request,页面跳转正确!" else: print"点击顶部导航的Contract Request,页面跳转正确!---<BUG15>" time.sleep(1) browser.find_element_by_xpath("//table[@id='list']/tbody/tr[1]/td[2]/div/a").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[5]/a").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[6]/a/span").click() time.sleep(2) te=browser.find_element_by_xpath("//ul[@id='menu']/li[6]/a/span") time.sleep(3) webdriver.ActionChains(browser).move_to_element(te).perform() time.sleep(3) browser.find_element_by_xpath("//ul[@id='menu']/li[6]/ul/li[2]/a").click() time.sleep(2) browser.find_element_by_id("btnNew").click() time.sleep(1) browser.find_element_by_id("btnCancel").click() time.sleep(1) browser.find_element_by_xpath("//ul[@id='menu']/li[7]/a").click() time.sleep(1) reports=browser.find_element_by_xpath("html/body/div[2]/div/div[2]/div[1]/div/ul") webdriver.ActionChains(browser).move_to_element(reports).perform() time.sleep(2) browser.find_element_by_xpath("html/body/div[2]/div/div[2]/div[1]/div/ul/li/ul/li[1]/a").click() time.sleep(2) browser.find_element_by_id("btnSearch").click() time.sleep(2) reportss=browser.find_element_by_xpath("html/body/div[2]/div/div[1]/div[1]/div/ul/li/span") webdriver.ActionChains(browser).move_to_element(reportss).perform() time.sleep(1) browser.find_element_by_xpath("html/body/div[2]/div/div[1]/div[1]/div/ul/li/ul/li[2]/a").click() print"ok %s" %(browser.current_url)