Skip to content

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
Discussion options

You must be logged in to vote

You're mixing the sb pytest fixture with the Driver manager. That's two different formats. Pick one from https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md

Here's an example with the Driver manager:

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]")
    

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@narendarbhogala
Comment options

@mdmintz
Comment options

@narendarbhogala
Comment options

@mdmintz
Comment options

Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants