Operate the elements

1.Simple operation

(1). Click()

(2). Clear()

(3). Send_Keys()

 

2. Submit the form

submit()

 

3.Keyboard operation

from selenium.webdriver.common.keys import Keys

.send_keys(Keys.ENTER)

.send_keys(Keys.F1)

.send_keys(Keys.CONTROL,'c')

.send_keys(Keys.CONTROL,'v')

.send_keys(Keys.CONTROL,'a')

.send_keys(Keys.CONTROL,'X')

.send_keys(Keys.TAB)

 

4.Mouse operation

from selenium.webdriver.common.action_chains import ActionChains

ActionChains(driver).move_to_element(mouse).perform()

context_click()

double_click()

 

posted @ 2017-05-16 15:16  Linazhu  阅读(131)  评论(0编辑  收藏  举报