I have a test cases written in python selenium and when I try to get the text from a web element, it fails. I tried the following before get text on that web element to check if the code identifies the element but still fails
- Find if element in the page(this line pass in the test case). It identifies that element and but fails to get the text
- Find if element is visible (this line pass in the test case) - It identifies that element is visible and but fails to get the text
- Find if element is enabled (this line pass in the test case) -It identifies that element is enabled and but fails to get the text
If I do sleep of 1 second. Then the text is extracted from the element. I don't want to give this sleep in my test case. Please tell me why it fails and what can i do other that sleep to get this element.
note -silmiarly i have drop down element for which the same happens.
please advise