Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Michael Mintz
    @mdmintz
    Version 1.26.2 is now the latest version of SeleniumBase
    Michael Mintz
    @mdmintz
    Version 1.26.3 is out. SeleniumBase runs faster in headless mode because I removed the pyvirtualdisplay requirement and replaced it with improvements over it.
    Peter Nguyen Tr
    @PeterNgTr
    hi, I just tried the v1.26.3 and noticed that there is an issue with hover_and_click.
    venv/lib/python3.7/site-packages/seleniumbase/fixtures/base_case.py:1969: in hover_and_click
        hover_selector, by=hover_by, timeout=timeout)
    venv/lib/python3.7/site-packages/seleniumbase/fixtures/base_case.py:2169: in wait_for_element_visible
        self.driver, selector, by, timeout)
    it worked fine on 1.24.1
    Michael Mintz
    @mdmintz
    The following worked for me:
            self.open("https://www.katalon.com/")
            self.hover_and_click("#bs-navbar-main-collapse > ul > li:nth-child(5) > a", "#bs-navbar-main-collapse > ul > li:nth-child(5) > ul > li:nth-child(1) > a")
    @PeterNgTr I might be your page changed. I was able to use it successfully.
    Peter Nguyen Tr
    @PeterNgTr
    I'll double check. Thanks for checking it out!
    Michael Mintz
    @mdmintz
    Chrome version 76 was just released. Chrome users will get automatically upgraded. This may break your tests depending on which version of ChromeDriver is installed on your machines. I've updated the seleniumbase install chromedriver method so that you get a compatible driver for the most number of Chrome versions. This takes effect in seleniumbase 1.26.4
    Additionally, w3c will be turned on during Chrome runs.
    Let me know if you see any issues.
    Sy
    @symonk
    We really need a way for seleniumbase to be properly used with pytest fixtures , I think with an out of the box solution seleniumbase usage would increase massively
    Only supported are hack around parametrised and using of auto use only fixtures all because of unittest.testcase
    Injecting into request.cls is a complete hack and we are losing probably the single best use of pytest as a result
    Happy to have an in-depth discussion on how it can become viable 😎
    Michael Mintz
    @mintzworld_twitter
    @symonk Let’s chat / video chat about this over the weekend. I have some ideas. I’ll need to know more about what you’re looking for.
    Sy
    @symonk
    Sounds good ! Il draft up some gists to demonstrate use cases
    It boils down to base case extending unittest testcase which kinda silos it into a non pytest friendly solution, ideally seleniumbase shouldn’t be concerned with a test runner but I can understand it’s hard to change that, maybe we can come up with something
    Michael Mintz
    @mintzworld_twitter
    @symonk Are you referring to class fixtures, method fixtures, or supporting both? I can probably create a fixture for BaseCase, but will need more than one, depending on whether the test method stands alone, or inside a class.
    Sy
    @symonk
    Just in general it is impossible to get fixture return values into tests, auto use fixtures are ok but of course you need a hack to get a value from them such as injecting into request.cls.foobar . Pytest doesn’t support fixtures properly when running unittest tests (which base case forces everyone to do without choice)

    The following pytest features work in unittest.TestCase subclasses:

    Marks: skip, skipif, xfail;
    Auto-use fixtures;
    The following pytest features do not work, and probably never will due to different design philosophies:

    Fixtures (except for autouse fixtures, see below);
    Parametrization;
    Custom hooks;
    Third party plugins may or may not work well, depending on the plugin and the test suite.

    This imo is the greatest limitation of seleniumbase and makes scalable pytest based projects almost impossible to do effectively
    Michael Mintz
    @mdmintz
    Hi @symonk I think I'm getting close to finding a solution.
    Michael Mintz
    @mdmintz
    I found it. Tested it. And it works.
    Sy
    @symonk
    oh nice, got a branch i can look at?
    JosephWard.tech
    @JosephWardDotTech
    I'd also be interested in seeing this.
    Michael Mintz
    @mintzworld_twitter
    It’s already on master branch. See the latest release.
    Michael Mintz
    @mintzworld_twitter
    https://www.meetup.com/GDGCloudBoston/events/230839686/ You can thank the Google people for that. That meetup was from when I demoed SeleniumBase in front of a large crowd at Google.
    Michael Mintz
    @mdmintz
    The web-comic used for SeleniumBase example tests updated their website (https://xkcd.com/), so I had to make updates to the example tests to make them work all the way from start to finish again.
    Peter Nguyen Tr
    @PeterNgTr
    hi, I'm trying to use the selenium grid when running tests.
    I'm following the guide here: https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/utilities/selenium_grid/ReadMe.md
    selenium grid is up:
     [SUCCESS] Selenium-WebDriver Grid Hub started successfully.
    
    Grid Hub console: http://127.0.0.1:4444/grid/console
    when starting the test pytest -k 'test_C5764_Quantity_assertion' --server=127.0.0.1 --port=4444
    it draws the error
    tests/commons/base.py:72: in setUp
        super(BaseTestCase, self).setUp()
    venv/lib/python3.7/site-packages/seleniumbase/fixtures/base_case.py:3267: in setUp
        disable_csp=self.disable_csp)
    venv/lib/python3.7/site-packages/seleniumbase/fixtures/base_case.py:2783: in get_new_driver
        disable_csp=disable_csp)
    venv/lib/python3.7/site-packages/seleniumbase/core/browser_launcher.py:277: in get_driver
        proxy_user, proxy_pass, user_agent, cap_file, disable_csp)
    venv/lib/python3.7/site-packages/seleniumbase/core/browser_launcher.py:302: in get_remote_driver
        desired_capabilities=capabilities)
    venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:157: in __init__
        self.start_session(capabilities, browser_profile)
    venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:252: in start_session
        response = self.execute(Command.NEW_SESSION, parameters)
    venv/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute
        self.error_handler.check_response(response)
    Michael Mintz
    @mintzworld_twitter
    Hi @PeterNgTr You also need a Selenium Node when running with the Selenium Grid.
    Peter Nguyen Tr
    @PeterNgTr
    ah, sorry, I missed that part.
    thanks Michael!
    Peter Nguyen Tr
    @PeterNgTr
    seems like we didn't have the possiblity to set prefer window size and send it to cloud service like browserstack, right @mintzworld_twitter?
    Michael Mintz
    @mintzworld_twitter
    Peter Nguyen Tr
    @PeterNgTr
    cool. works like a charm. Thanks!
    Sy
    @symonk
    @mintzworld_twitter was there any updates since v1.23 regarding alerts? our native browser alerts are accepting in a millisecond then saying they arent there for 10 seconds
    Sy
    @symonk
    wait_for_and_accept_alert() isnt playing too nice with our native alerts, its accepting them within 0.1 seconds then complaining they never existed after 10 secs
    Michael Mintz
    @mdmintz
    @symonk
    import time
    from seleniumbase import BaseCase
    
    
    class MyTestClass(BaseCase):
    
        def test_alerts(self):
            self.open("about:blank")
            self.execute_script('window.alert("ALERT!!!")')
            time.sleep(1.2)  # Not needed (lets you see the alert pop up)
            self.wait_for_and_accept_alert()
            time.sleep(0.8)  # Not needed (lets you see the alert go away)
    Works for me
    Michael Mintz
    @mdmintz
    Version 1.30.0 is out! And the next release won't be until at least September.
    Sy
    @symonk
    chromedriver 76 won't work with seleniumbase alerts i guess? they changed alert behaviour in-line with W3C standards
    might need an update
    Michael Mintz
    @mintzworld_twitter
    @symonk Try the chromedriver that gets installed with “seleniumbase install chromedriver”. There may be an issue with the latest one.
    Also, I just got married and am on my honeymoon in Rome. I arrived there today after a 4-hour layover in Amsterdam. Responses will be delayed!
    Sy
    @symonk
    oh congratulations! :) enjoy your holiday will catch up with you after
    Peter Nguyen Tr
    @PeterNgTr
    Wow. Congratulations! I’m going to Roma tomorrow as well.
    Michael Mintz
    @mintzworld_twitter
    Thank you!