How to use sb fixure for pytest with Mobile Chrome mode without command line and in the code #2211
Answered
by
mdmintz
narendarbhogala
asked this question in
Q&A
-
The below code is opening two chrome drivers for me and the actions are not performed on the Mobile driver mode.
|
Beta Was this translation helpful? Give feedback.
Answered by
mdmintz
Oct 26, 2023
Replies: 1 comment 4 replies
-
You're mixing the Here's an example with the from seleniumbase import Driver
driver = Driver(mobile=True)
try:
driver.open("https://www.skype.com/en/get-skype/")
driver.assert_element('[aria-label="Microsoft"]')
driver.assert_text("Download Skype", "h1")
driver.highlight("div.appBannerContent")
driver.highlight("h1")
driver.assert_text("Skype for Mobile", "h2")
driver.highlight("h2")
driver.highlight("#get-skype-0")
driver.highlight_click("span[data-dropdown-icon]")
driver.highlight("#get-skype-0_android-download")
driver.highlight('[data-bi-id*="ios"]')
finally:
driver.quit() |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
mdmintz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You're mixing the
sb
pytest fixture with theDriver
manager. That's two different formats. Pick one from https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.mdHere's an example with the
Driver
manager: