Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Sunday, December 14, 2014

How to get coordinates or dimensions of web element with Python using Selenium Webdriver

driver = webdriver.Firefox()
e = driver.find_element_by_xpath("//someXpath")
location = e.location
size = e.size
print(location)
print(size)

{'y': 202, 'x': 165}
{'width': 77, 'height': 22}