Is there any way to checking if html inputs
interfere each other visually selenium python?
For example below image has overlapping elements:
And second below image has no ovarlapping elements:
I want to check this in some different web page sizes like 800*600
and 1024*768
.
You can get get location
and size
properties of each relevant element and calculate if there are interferences or not.
Like this:
driver = webdriver.Firefox()
e = driver.find_element_by_xpath("//someXpath")
location = e.location
size = e.size
w, h = size['width'], size['height']
print(location)
print(size)
print(w, h)
The output here will be something like this:
{'y': 202, 'x': 165}
{'width': 77, 'height': 22}
77 22