Unable to Pass function as a parameter for Selector $ #2220
yskoverride
started this conversation in
General
Replies: 2 comments 1 reply
-
Please try changing your syntax to
|
Beta Was this translation helpful? Give feedback.
1 reply
-
There's a problem with the selector snippet you provided for example
is not the right way of selecting multiple classes it is
It might be worth testing these selectors to use the right expression on the browser before using them on taiko. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The documentation on taiko suggests that we can pass a function as parameter for the selector $.
$(() => {return document.querySelector('#foo');})
But when i am trying to use this as a selector for writing text into a field with below command
write("Test",into($(() => {return document.querySelector('#txtActionItemTitle');})))
I get the below error
Error: Query function should return a DOM Node or DOM NodeList, run .trace for more info.
I tried executing the function
write("Test", into( $((function(){ return document.querySelector('#txtActionItemTitle');})())))
I get error "Uncaught document is not defined"
I confirmed that the element is available with command write("Test", into( $(#txtActionItemTitle')))
I am not sure why its not working when i am passing a function. Please help me out.
Beta Was this translation helpful? Give feedback.
All reactions