Exemplo n.º 1
0
from selenium import webdriver
from framework.base_page import BasePage
from logs.log import log1

driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
s = driver.window_handles

kw = ('id', 'kw')

base_driver = BasePage(driver)
base_driver.send(kw, 'selenium+python')
base_driver.framework_sleep(2)

su = ('id', 'su')
base_driver.click(su)
base_driver.get_img()
base_driver.framework_sleep(3)

log1.info(base_driver.get_title())

base_driver.framework_quit()
Exemplo n.º 2
0
from selenium import webdriver
from framework.base_page import  BasePage

driver = webdriver.Chrome()
driver.get("https://www.baidu.com")

s = driver.window_handles

b_driver = BasePage(driver)
kw = ('id','kw')

b_driver.send(kw,'富璟科技')
b_driver.framework_sleep(3)
b_driver.send(kw,"凯捷中国")

su = ('id','su')

b_driver.click(su)
b_driver.get_img()
b_driver.framework_sleep(2)
b_driver.framework_quit()