<ruby id="h6500"><table id="h6500"></table></ruby>
    1. <ruby id="h6500"><video id="h6500"></video></ruby>
          1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>

            基于Selenium的web自動(dòng)化框架(4)

            發(fā)表于:2016-11-23來(lái)源:測試改進(jìn)工場(chǎng)作者:測試改進(jìn)工場(chǎng)點(diǎn)擊數: 標簽:框架
            ) cancelButton = (By.XPATH, //button[@class=\btn btn-warning ng-binding\][@ng-click=\cancel()\] ) okButton = (By.XPATH, //button[@class=\btn btn-primary ng-binding\][@ng-click=\ok()\] ) # Get username
            ) cancelButton = (By.XPATH,'//button[@class=\"btn btn-warning ng-binding\"][@ng-click=\"cancel()\"]') okButton = (By.XPATH,'//button[@class=\"btn btn-primary ng-binding\"][@ng-click=\"ok()\"]') #Get username textbox and input username def set_username(self,username): name = self.driver.find_element(*LoginPage.usename) name.send_keys(username) #Get password textbox and input password, then hit return def set_password(self, password): pwd = self.driver.find_element(*LoginPage.password) pwd.send_keys(password + Keys.RETURN) #Get pop up dialog title def get_DiaglogTitle(self): digTitle = self.driver.find_element(*LoginPage.dialogTitle) return digTitle.text #Get "cancel" button and then click def click_cancel(self): cancelbtn = self.driver.find_element(*LoginPage.cancelButton) cancelbtn.click() #click Sign in def click_SignIn(self): okbtn = self.driver.find_element(*LoginPage.okButton) okbtn.click()
            復制代碼

             

             

            采用頁(yè)面模式來(lái)管理頁(yè)面和測試用例有很多好處,主要體現在:

            • 簡(jiǎn)單并且清晰

            每個(gè)頁(yè)面都有單獨的類(lèi)來(lái)封裝頁(yè)面元素和操作,讓頁(yè)面操作更加具體化,而不是相對獨立的。

            比如未使用頁(yè)面模式,測試用例的輸入用戶(hù)名和密碼的代碼:

            原文轉自:http://www.cnblogs.com/AlwinXu/p/5836709.html

            ...

            熱門(mén)標簽

            老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月
              <ruby id="h6500"><table id="h6500"></table></ruby>
              1. <ruby id="h6500"><video id="h6500"></video></ruby>
                    1. <progress id="h6500"><u id="h6500"><form id="h6500"></form></u></progress>