Setting value on an element using the JSON object returned by findElement #3357
Unanswered
qwertynik
asked this question in
Help Needed
Replies: 1 comment 1 reply
-
You can use global Example: const searchBox = element('<selector>');
searchBox.sendKeys('webdriver') Read more about element APIs: here |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Have been able to set the value for an input field using this snippet:
Can the value for the input field be set using the element variable, which is a WebElement JSON object?
The reason for doing this is to reuse the element later, if possible, and reduce the total DOM queries done.
Using the
element
object is also a common pattern of working with DOM elements in selenium. For instance, notice the usage hereLooking forward to your responses.
Beta Was this translation helpful? Give feedback.
All reactions