by

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
    OK, thank you. And also let me know if it works with the latest version of SeleniumBase
    There have been other changes since then that may have fixed your issue.
    Simon K
    @symonk
    i want to roll up, but i think theres an issue on pytest that would prevent us from going, ive been contributing there a lot il chase it up
    2 seconds
    pytest-dev/pytest#7000, maybe resolved and released
    Michael Mintz
    @mdmintz
    That was fixed
    Simon K
    @symonk
    yep i see, i will roll us up as part of this work :)
    Michael Mintz
    @mdmintz
    I've got another release coming today :)
    Simon K
    @symonk
    sure i wont be merging until tomorrow, so il go with latest for now and get through CI first :)
    Michael Mintz
    @mdmintz
    OK :)
    SeleniumBase now supports 10 languages.
    I have some language updates coming today.
    And deferred assertions, which let you make multiple assertions on the same page and not fail the test until after all of them have been made (if any fail) so that they're grouped together.
    Simon K
    @symonk
    ah ok cool, we rolled our own soft assert helper
    Aj
    @Aj34497482_twitter
    @mdmintz i have a small scenario where there is a save button which comes in multiple places in the form, the xpath is same for the button, so i used the same one for all but now face an exeption for the second save button itself stating that "element is not clickable at point (410, 485). Other element would receive the click: " how to overcome this scenario and this comtinues still the form entirely have many save buttons, pls suggest a simple method to solve this michael!!
    Michael Mintz
    @mdmintz
    @Aj34497482_twitter Use:
    self.js_click(SELECTOR)
    Glenn McComb
    @lenymo
    Hello, I'm really enjoying using SeleniumBase... loving going through my tests removing waits and removing a bunch of extra code
    I've been going through the docs and I can't find an example of SeleniumBase finding child elements from a parent element... at the moment I'm still doing this (python):
    # Find elem using SeleniumBase:
    elem = self.find_element(".element")
    
    # Use Selenium to find descendent of elem.
    child_elem = elem.find_element_by_css_selector(".child-element")
    Glenn McComb
    @lenymo
    is there a SeleniumBase implementation of that?
    Michael Mintz
    @mdmintz
    Hi @lenymo , there isn't that at the moment, but I could add this feature in a later release of SeleniumBase.
    Glenn McComb
    @lenymo
    np, was mostly making sure I hadn't missed it in the docs
    thanks for the reply
    baruhut
    @baruhut
    hi @mdmintz, i want to write condition if "5000555" visible on the webpage, then click its checkbox. could you help me to write the script contains selectors? here is my html '<table class="tabtrans" >
    <thead>
                                                                                          </thead>
    
                                                                                          <tbody>
    
                                                                                                                                       <tr class="even">
    
                                                                                                                                                      <td class="tickbox">
                                                                                                                                                                     <input type="checkbox" name="del" value="0">
                                                                                                                                                      </td>
                                                                                                                                                      <td>
                                                                                                                                                                     2000222
                                                                                                                                                      </td>
    
                                                                                                                                       </tr>
    
                                                                                                                                       <tr class="alt">
    
                                                                                                                                                      <td class="tickbox">
                                                                                                                                                                     <input type="checkbox" name="del" value="1">
                                                                                                                                                      </td>
                                                                                                                                                      <td>
                                                                                                                                                                     3000333
                                                                                                                                                      </td>
    
                                                                                                                                       </tr>
                                                             '
    Michael Mintz
    @mdmintz

    @baruhut There are a few ways to do this. Here's one: Create an element list of all the checkboxes with:

    checkboxes = self.find_visible_elements('input[type="checkbox"]')

    Then loop through the list and click the one if it contains the number you want:

    for checkbox in checkboxes:
        if "50005555" in checkbox.text:
            checkbox.click()
    baruhut
    @baruhut
    It found what i was looking but still the checkbox was not checked. Also i added break inside if. Here is my html. I hope this time is more proper than the prev. alt
    baruhut
    @baruhut
    baruhut
    @baruhut
    I got it. Lines on the same link above. Thanks
    Michael Mintz
    @mdmintz
    Great!
    Michael Mintz
    @mdmintz
    https://github.com/seleniumbase/SeleniumBase/releases/tag/v1.39.1 shipped last night. Alert-handling simplified, Deferred Assertions rebranded, Updated translations.
    Glenn McComb
    @lenymo

    https://github.com/seleniumbase/SeleniumBase/releases/tag/v1.39.1 shipped last night. Alert-handling simplified, Deferred Assertions rebranded, Updated translations.

    interesting, I was having some intermittent issues with wait_for_and_accept_alert on multiple alerts in sequence... A click on an element triggers an AJAX request, which when completed triggers a window.alertconfirmation.

    Oddly, I was able to get the following to work reliably:

    self.find_element(".button").click()
    self.wait_for_and_accept_alert()

    but not

    self.click(".button")
    self.wait_for_and_accept_alert()
    is the "Simplify code for handling alerts" just a cosmetic change to the method name?
    Michael Mintz
    @mdmintz
    @lenymo It's just a cosmetic change. I wanted to shorten the method name, but also keep the original name for backwards compatibility.
    Glenn McComb
    @lenymo
    cool
    Swj-ningbo
    @Swj-ningbo
    @mdmintz 我觉得中文readme已经完成了.我该需要在原来的readme中加跳转链接吗?
    I think the Chinese readme is done. Should I add a jump link to the original readme?
    Michael Mintz
    @mdmintz
    On the https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/translations.md page there is a row that says: “Chinese / 中文”. Turn that into a link. There’s also a duplicate copy here: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/translations/ReadMe.md
    ^^^ @Swj-ningbo
    When I update the main ReadMe later, I’ll create a section that also includes that link, so that there will be 3 total. But for now, in the 2 translations ReadMe files.
    Michael Mintz
    @mdmintz
    seleniumbase_SeleniumBase__✅_Reliable_Browser_Automation___Testing_with_a_Python_API_.png
    @Swj-ningbo At the top of the main ReadMe file, there is already a Languages link that will take people to the Translations ReadMe
    Simon K
    @symonk
    @mdmintz re my insecure certs, fixed by what we spoke about :)
    im noticing since upgrading tho, some of our wrapper was try: except around base_case .get_text() and its no longer catching, did you change the exception types at all?

    e.g this doesnt catch:

            try:
                return self.get_text(profile_locators.NUMBER_OF_LICENSED_USERS)
            except ElementNotVisibleException as exc:
                ...

    did get_text change what it raises?

    ah yes, it changed massively - i should of checked on the breaking changes first :D
    timeout raising a general Exception is kinda weird tho
    Simon K
    @symonk
    now to handle around it, you are forcing users to catch general Exception which is terrible practice
    Michael Mintz
    @mdmintz
    Hi @symonk , I can change that back. I was simplifying exceptions, but if people were actually trying to catch the exceptions themselves, it would be different.
    Actually @symonk , for your example you should probably be using:
    if self.is_text_visible(profile_locators.NUMBER_OF_LICENSED_USERS):
        return self.get_text(profile_locators.NUMBER_OF_LICENSED_USERS)
    else:
        ...
    Michael Mintz
    @mdmintz
    Or if you still want to use try/except for your code:
    try:
        return self.get_text(profile_locators.NUMBER_OF_LICENSED_USERS)
    except Exception as exc:
        ...
    Michael Mintz
    @mdmintz
    But I'll probably put back the specific exceptions in the next release, even though the error output will be slightly larger.