-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheasy_test.py
More file actions
40 lines (31 loc) · 1.33 KB
/
easy_test.py
File metadata and controls
40 lines (31 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# coding=utf8
import base_easy
from selenium.webdriver.common.keys import Keys
import utils
import ConfigParser
from selenium.webdriver.common.action_chains import *
import time
#http://seleniumhq.github.io/selenium/docs/api/py/
#https://selenium-python-zh.readthedocs.io/en/latest/
class Easy_wbtest(base_easy.Base_Easy):
def test(self):
self.driver.get("https://www.baidu.com")
elem = self.driver.find_element_by_name("wd")
elem.send_keys("python selenium")
elem.send_keys(Keys.ENTER)
#self.driver.get("http:www.google.com")
for handle in self.driver.window_handles:
print self.driver.switch_to_window(handle)
print self.driver.get_cookies()
print self.driver.get_window_position()
# print self.driver.get_window_rect()
print self.driver.get_window_size()
print self.driver.refresh()
print self.driver.current_window_handle
print self.driver.current_url
print self.driver.current_window_handle
print self.driver.name
print self.driver.title
# ActionChains(self.driver).move_by_offset(100,100)
if __name__ == '__main__':
Easy_wbtest().test()