Replies: 2 comments 3 replies
-
SB is a context manager, so you can not store SB within a variable until you use as a context manager. You have to do this:
|
Beta Was this translation helpful? Give feedback.
2 replies
-
See the 25 officially supported SeleniumBases Syntax Formats.
Eg. from seleniumbase import SB
with SB() as sb:
sb.open("seleniumbase.io/simple/login")
sb.type("#username", "demo_user")
sb.type("#password", "secret_pass")
sb.click('a:contains("Sign in")')
sb.assert_exact_text("Welcome!", "h1")
sb.assert_element("img#image1")
sb.highlight("#image1")
sb.click_link("Sign out")
sb.assert_text("signed out", "#top_message") |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am trying to rework some of the codebase with SB and its feature. We did use Driver so instead of rewriting everything with SB I'd like to do it step by step.
When instatiating SB like this:
It returned the following:
AttributeError: '_GeneratorContextManager' object has no attribute 'driver'
I am using seleniumbase 4.37.2.
Any ideas ? Thanks
Beta Was this translation helpful? Give feedback.
All reactions