That zero number indicates the 1st argument you are passing. You are passing the argument as a second parameter in the method ryt. Similarly if you have more than one element to handle then you need pass those as the arguments in the method and during that time you can increase that zero.
@@HYRTutorials btw you have great collection of playlist. Good job. I learnt a lot from xpath playlist.. looking forwars for more such videos . Thanks...
Hi i am using Rselenium and using this way to enter long text in textbox, it write the text but if i click outside the anywhere in website outside of text box, the written text goaway, looklike it only show that it wrote but it accuallty not wrote.
@@HYRTutorials Hi, issue got resolve, first i used the Excutescript way then i add a blank using sendkey and it start showing all the data. thank you so much.
Hi Thanks for the video. I did tried the same thing but I am getting the exception "JavascriptException: javascript error: Cannot set property 'value' of null". Here is my code. JavascriptExecutor jse = (JavascriptExecutor) driver; jse.executeScript("document.getElementById('my id here').value ='ABC'"); Please note that I have run the code through browser console and it is working . The above exception I get when run as selenium Test. Could you please advice what to do?
So it's basically not able to identify the element from the script. That might be bcz of the element is present inside any frame or synchronisation issue. It works in browser console bcz there it doesn't bother about frames or sync issues as the page is completely loaded.
How to perform click action or input text onto webelement that created using document.evaluate ? becoz after singleNodeValue.click() not working. help me on this
sir able to add value in email text box but when tried using document.evaluate js.executeScript("document.evaluate('//input[@type='password']',document, null, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue.value=''password'") its not working
📌 JavascriptExecutor Playlist Link: bit.ly/2FhNXwS
✴ Checkout my other playlists: bit.ly/3gLIAVL
☕ Buy me a coffee: bit.ly/33ljBWc
your teaching is so good. helping a lot
Thank you buddy 😃
Your tutorials r really good. Liked the way you explain things.
Thanks a lot 😊
Nice detailed explanation , well done
Thank you!
Very nice tutorial
Will that argument[0] will always be 0 in the second method or we need to write any other number other than 0?
That zero number indicates the 1st argument you are passing.
You are passing the argument as a second parameter in the method ryt.
Similarly if you have more than one element to handle then you need pass those as the arguments in the method and during that time you can increase that zero.
Thanks for such nice video, will you please show how we can remove the text from TextBox using JavaScript. TIA.
For clear operation there is no command directly but you can set the empty text to that textbox
eg: userName_txt.value="";
I am curious, why you did not use document.querySelector("#email")?
We can use that as well.
You can consider this as another way to find the element.
@@HYRTutorials btw you have great collection of playlist. Good job. I learnt a lot from xpath playlist.. looking forwars for more such videos . Thanks...
@@dinkarinjosh thankyou 😊
Hi, how can we copy entire XML file and paste in a text box using Selenium java
First try to read the entire xml data into one string variable and then you can use that string in sendkeys method
Hi i am using Rselenium and using this way to enter long text in textbox, it write the text but if i click outside the anywhere in website outside of text box, the written text goaway, looklike it only show that it wrote but it accuallty not wrote.
are you able to enter the text in the textbox using native sendkeys method?
@@HYRTutorials Hi, issue got resolve, first i used the Excutescript way then i add a blank using sendkey and it start showing all the data. thank you so much.
yo thanx
Enjoy buddy
Hi Thanks for the video. I did tried the same thing but I am getting the exception "JavascriptException: javascript error: Cannot set property 'value' of null". Here is my code.
JavascriptExecutor jse = (JavascriptExecutor) driver;
jse.executeScript("document.getElementById('my id here').value ='ABC'");
Please note that I have run the code through browser console and it is working . The above exception I get when run as selenium Test. Could you please advice what to do?
So it's basically not able to identify the element from the script.
That might be bcz of the element is present inside any frame or synchronisation issue.
It works in browser console bcz there it doesn't bother about frames or sync issues as the page is completely loaded.
Try to identify the element alone using javascript from the automation script.
Once that is working then u can set the text.
How to perform click action or input text onto webelement that created using document.evaluate ?
becoz after singleNodeValue.click() not working. help me on this
Send me your script on hyadagirireddytutorials@gmail.com
Can you make POM from scratch in telugu . How to create page object model from scratch.
Anna Can you make full python tutorial in telugu from sratch.
sir able to add value in email text box but when tried using document.evaluate
js.executeScript("document.evaluate('//input[@type='password']',document, null, XPathResult.FIRST_ORDERED_NODE_TYPE).singleNodeValue.value=''password'") its not working
Try the same in chrome console