V
V
vaflya2018-07-25 14:17:02
Python
vaflya, 2018-07-25 14:17:02

How to check the visibility of a page element?

Good afternoon! I will not dissemble, they gave a test task, write an autotest for Yandex. One point that raised the question is:
check for the appearance of the search box hint list popup.
My thoughts are:
-check by element id (the list has no id)
-check the suggest2 class (but the element is hidden in the DOM from the very beginning)
-check the presence of the element in the DOM and check it for the presence of the popup_visibility_visibale class The
question is, having received the element
[code]
Try:
browser.find_element_by_class('suggest2')
browser.find_element_by_class('popup_visibility_visibale')
Except:
print('element hidden')
[/code]
How to check element for another class?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Glukhovtsev, 2018-07-26
@vaflya

It is better to write a selector that will find the given list regardless of its visibility and apply the isDisplayd method to this object

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question