How can I effectively use the selenium base equivalent of element.find_element()? #1828
nwest-encoura
started this conversation in
General
Replies: 1 comment 2 replies
-
Hello. In your example, it appears you're trying to find multiple elements with the same Note that SeleniumBase also has some list methods, (eg. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am refactoring some UI tests which were built with raw selenium.
The solution uses a page object model which largely returns web elements which can then do things like click or send_keys.
The problem with this is that I have an element, lets call it
card
, which I get by using a generic locator withcard = driver.find_elements(By.ID, "card")[0]
.I can then use this web element to click on the close button for example
card.find_element(By.ID, "close-btn")
.Is there a selenium base equivalent that lets me do a similar thing? Right now selenium base's
find_elements
returns web elements that must then utilize seleniums built infind_element
methods, but I would much rather use selenium basesfind_element
method, and forego having to maintain a mixture of locators and methods.Beta Was this translation helpful? Give feedback.
All reactions