1

Using seleniumbase I just want to check if some text is available. I just want to get a boolean flag, indicating text is available (True) or not (False).

The methods provided by seleniumbase seem to throw an exception if the text is not available. Is there another method that just returns a boolean flag, or do I have to use a try/except construct?

1 Answer 1

1

Just use self.is_text_visible():

self.is_text_visible(text, selector="html")

Eg:

self.is_text_visible("Welcome")
self.is_text_visible("Welcome", "h1")
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.