Based UI test automation framework set up under the python language (C)

baidu_homepage.py: call the usual method of operation

pageobjects file as follows:

 

 

Base_page.py commonly packaged call operation method, and cleaved by => individuals feel that this step is not necessary, but in order to prevent excessive writing in the implementation of the code case, so the package may or may not be based on individual circumstances, back call baidu_homepage.py and will explain the two methods baidu_homepage.py not called, the specific code as follows:

 1 # coding=utf-8
 2 from framework.base_page import BasePage
 3 
 4 
 5 class HomePage(BasePage):
 6     input_box = "id=>kw"
 7     search_submit_btn = "xpath=>//*[@id='su']"
 8 
 9     def type_search(self, text):
10         self.type(self.input_box, text)
11 
12     def send_submit_btn(self):
13         self.click(self.search_submit_btn)

 

Guess you like

Origin www.cnblogs.com/yk617558302/p/11328414.html