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
    Chromedriver 78? Or Chrome 78? Or both?
    Haven't seen issues yet, but I'm looking.
    Sy
    @symonk
    chrome79 with chromedriver 79
    will complain about ssl certs most likely on your current implementation, maybe the desired capabilities etc will need changed or well need to pass our own now in --cap_file
    with --browser=remote
    Michael Mintz
    @mintzworld_twitter
    With the latest version of SeleniumBase? I ran my_first_test with no errors with Chromedriver 79 on Chrome 79 with the latest SeleniumBase. (On a MAC)
    Sy
    @symonk
    remote browser?
    could you try with a grid
    Michael Mintz
    @mintzworld_twitter
    I’ll try that. On my way to work now, but I’ll get to that sometime today/tonight.
    Michael Mintz
    @mdmintz
    @symonk No issues using a Selenium Grid on Chrome and Chromedriver 79
    $ pytest my_first_test.py --server=127.0.0.1
    =============================================== test session starts ===============================================
    platform darwin -- Python 3.7.0, pytest-5.3.2, py-1.8.0, pluggy-0.13.1
    rootdir: /Users/michael/github/SeleniumBase, inifile: pytest.ini
    plugins: html-2.0.1, xdist-1.30.0, timeout-1.3.3, rerunfailures-8.0, ordering-0.6, forked-1.1.3, metadata-1.8.0, cov-2.8.1, seleniumbase-1.34.3
    collected 1 item                                                                                                  
    
    my_first_test.py Starting ChromeDriver 79.0.3945.36 (3582db32b33893869b8c1339e8f4d9ed1816f143-refs/branch-heads/3945@{#614}) on port 38240
    Only local connections are allowed.
    Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
    .
    =============================================== 1 passed in 10.69s
    Peter Nguyen Tr
    @PeterNgTr
        def setUp(self):
    >       super().setUp()
    
    tests/pages/test_pdp.py:588: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    tests/commons/base.py:133: in setUp
        self.open_with_set_window_size(site)
    tests/commons/base.py:216: in open_with_set_window_size
        self.open(url)
    /usr/local/lib/python3.7/site-packages/seleniumbase/fixtures/base_case.py:90: in open
        self.driver.get(url)
    /usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:333: in get
        self.execute(Command.GET, {'url': url})
    /usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute
        self.error_handler.check_response(response)
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f69a5933128>
    response = {'status': 408, 'value': '{"value":{"error":"timeout","message":"timeout\\n  (Session info: headless chrome=77.0.3865.90)","stacktrace":"#0 0x55858c346959 \\u003Cunknown>\\n"}}'}
    when trying to initiate like 50 instances of chrome, I got those errors, any advices would be appreciated?
    Michael Mintz
    @mdmintz
    50 instances of Chrome at the same time? Without knowledge of your memory specifications, I'd only be guessing what went wrong.
    Peter Nguyen Tr
    @PeterNgTr
    :D running around 20 instances is fine :P
    Nik
    @LoshmanovNA
    Hi! Have a problem. My test class nested from BaseCase as in doc example, but in that way i cant use fixtures inside my test class. I get TypeError: test_func() missing 1 required positional argument some_fixture().Is there a way to use fixtures correctly?
    Michael Mintz
    @mdmintz
    @LoshmanovNA You should see the example where SeleniumBase is passed as a pytest fixture instead of as a class: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_pytest_parametrize.py
    Nik
    @LoshmanovNA
    @mdmintz exactly what i looking for, thanks!
    Sy
    @symonk
    @mdmintz are you sure you dont require a change to AcceptSSLCerts inline with chrome 79 changes? see my previous comment, i know you tested it but did you use a self signed cert site?
    denis
    @denis63799887_twitter
    Hi! I need my tests to run in an incognito window. How can I implement this in my code using Seleniumbase?
    Michael Mintz
    @mdmintz
    @symonk I tested it. I'd image there would be a lot of noise on StackOverflow if there was a breaking change for Selenium users from Chrome 79.
    Michael Mintz
    @mdmintz
    @denis63799887_twitter If you need it this second, add chrome_options.add_argument("--incognito") to seleniumbase/core/browser_launcher.py for your cloned copy of SeleniumBase. If you want it as a command line option, I can have it added to the next release of SeleniumBase within 15 hours if you open a ticket on the GitHub page.
    Releases are very frequent, and we're very accommodating on reasonable requests.
    denis
    @denis63799887_twitter
    Hello Michael, i like the option of having a command line to open in an anonymous window my tests...
    I will open the ticket.
    Thanks and much success to SeleniumBase!
    Sy
    @symonk
    It would only be self signed, I see various other wrappers in java updating it but il figure it out tomorrow
    Michael Mintz
    @mdmintz
    denis
    @denis63799887_twitter
    @mdmintz Thank you!
    Sy
    @symonk
    @mdmintz could we look at timeout-multiplier on a per timeout basis, small/medium/large etc? rather than a global one? thoughts?
    Michael Mintz
    @mintzworld_twitter
    @symonk That might overcomplicate things, as now there’s already very little difference between small and medium timeouts (6s vs 10s) and the large one is barely used. If SeleniumBase was created today, the small and medium timeouts would be the same (about 8s).
    cmolina
    @molinacarlos
    Greetings folks !!
    anybody knows how to get that in case of test failures, pytest finish test silently (without error details ) ?
    cmolina
    @molinacarlos
    done !. Use --tb=no pytest parameters
    denis
    @denis63799887_twitter
    Hi! The method "self.assert title()" has a automatically wait the a page finish loading ?
    I'm having problems where the "self.assert title()" method check is done before the page is fully loaded, returning a error.
    Michael Mintz
    @mdmintz
    @denis63799887_twitter Try v1.34.21
    @molinacarlos Great! I usually add --tb=short
    denis
    @denis63799887_twitter
    Thanks!
    denis
    @denis63799887_twitter

    Hi! I dont know if its a error but after the last versions this message error appears only when i used the --demo mode:
    E selenium.common.exceptions.InvalidElementStateException: Message: Failed to execute 'querySelector' on 'Document': 'div[class*=button is-secondary]:nth-of-type(1)' is not a valid selector. E (Session info: chrome=79.0.3945.117)

    my code is: self.click('(//div[contains(@class,"button is-secondary")])[1]', timeout=15)

    Without the --demo mode, the script works correclty.

    Michael Mintz
    @mdmintz
    @denis63799887_twitter I think I see the issue. In the conversion from XPath to CSS selector for the Javascript, the quotes were lost in the div class selector. Should've been div[class*="button is-secondary"]
    Michael Mintz
    @mdmintz
    I can look into fixing the XPath -> CSS converter in SeleniumBase, but in the meantime, use CSS Selectors when possible.
    denis
    @denis63799887_twitter
    Ok Michel thank you soo much... I will do.
    Michael Mintz
    @mdmintz
    @denis63799887_twitter In about 20 minutes I'll ship v1.34.23, which contains the fix
    Michael Mintz
    @mdmintz
    denis
    @denis63799887_twitter
    Thanks!
    A new question, what the practical difference of self.wait_for_element_present() and self.wait_for_element_visible() ?
    Michael Mintz
    @mdmintz
    @denis63799887_twitter present means the object is anywhere in the DOM. visible means that the CSS property is visible, meaning that you should be able to see the element on the page and interact with it.
    Here's a classic example. A web page has head and body tags, but the head isn't technically visible, even though it is there in the page source HTML:
    ipdb> self.is_element_present("head")                                                                
    True
    ipdb> self.is_element_visible("head")                                                                
    False
    ipdb> self.is_element_visible("body")                                                                
    True
    Michael Mintz
    @mdmintz
    You can be present and not visible, but if you are visible then you are also present.
    denis
    @denis63799887_twitter
    Thanks, with your explanation it became clearer.
    Karlo Abapo
    @karloabapo_twitter
    Hi guys. How can I pass a variable to an element attribute value? I tried assigning it but it doesn't work.
    today= getdate()
    
    # Before
    self.click('[date="01/22/20"]')
    
    # After
    # Clicking the date today using css selector
    
    self.click('[date="today"]')
    Michael Mintz
    @mdmintz
    @karloabapo_twitter You just passed today as a string in your example, not as a variable. Use:
    self.click('[date="%s"]' % today)
    jamie bernardin
    @jpbernardin_twitter
    Would love to make api requests from a driver that's been logged in. There's a seleniumrequests package that allows you to do that with their drivers. Wonder what the best way is to use that with SeleniumBase?
    jamie bernardin
    @jpbernardin_twitter
    scratch that.... seleniumrequests doesn't work correctly with headers.... so i'm not going to use it.