<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)化框架(3)

            發(fā)表于:2016-11-23來(lái)源:測試改進(jìn)工場(chǎng)作者:測試改進(jìn)工場(chǎng)點(diǎn)擊數: 標簽:框架
            頁(yè)面基類(lèi)BasePage.py: class BasePage(object): description of class # webdriver instance def __init__ (self, driver): self.driver = driver LoginPage頁(yè)面繼承自BasePage,并進(jìn)行Login Page的元素

            頁(yè)面基類(lèi)BasePage.py:

            class BasePage(object):  
                """description of class"""  
              
                #webdriver instance  
                def __init__(self, driver):  
                    self.driver = driver  

             

            LoginPage頁(yè)面繼承自BasePage,并進(jìn)行Login Page的元素定位及操作實(shí)現。代碼中定位了username和password,并且添加了設置用戶(hù)名和密碼的操作。

            復制代碼
            from BasePage import BasePage  
            from selenium.webdriver.common.by import By  
            from selenium.webdriver.common.keys import Keys  
              
            class LoginPage(BasePage):  
                """description of class"""  
                 #page element identifier  
                usename = (By.ID,'username')  
                password = (By.ID, 'password')  
                dialogTitle = (By.XPATH,"//h3[@class=\"modal-title ng-binding\"]" 
            
            
            
                       

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

            ...
            老湿亚洲永久精品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>