|
Hello SeleniumBase community, I'm currently using SeleniumBase for my testing automation tasks, and I frequently find myself using the EC.presence_of_all_elements_located((By.XPATH,"//h2[@Class='h4']/..")) method to wait for the presence of multiple elements on a page. However, I was wondering if there's a shorter or more concise method within SeleniumBase that accomplishes the same task? While the current method works well, I'm always interested in streamlining my code and making it more efficient. Any suggestions or insights would be greatly appreciated! |
Answered by
mdmintz
May 2, 2024
Replies: 2 comments 2 replies
|
For returning a list of elements: elements = driver.find_elements("h2")(It autodetects between CSS and XPath) For waiting on the first occurrence: driver.wait_for_element("h2") |
2 replies
Answer selected by
mdmintz
|
Thanks Michael!
El El jue, 2 may 2024 a las 17:15, Michael Mintz ***@***.***>
escribió:
… For the list:
elements = driver.find_elements("h2")
for element in elements:
# ...
—
Reply to this email directly, view it on GitHub
<#2739 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBXGU7DVF3KCLGZIUBJAXVDZAJKAHAVCNFSM6AAAAABHDX5PPCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TEOJWHA4DA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***
com>
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


For returning a list of elements:
(It autodetects between CSS and XPath)
For waiting on the first occurrence:
driver.wait_for_element. Eg: