Open dseah opened 1 year ago
It returned null meaning the element was not found under the query string. Perhaps in different setup, the element attribute changes.
Is there a way to find out what it changes to?
Simply inspect the HTML element as well as its structures carefully again on different environments and you will perhaps find a clue.
One thing I noted that the page loaded quite slow, could it be that script runs before the page finished loading? I see there's a wait function, but I'm not too sure how do I use it .
Tried adding objBrowser.wait(iscomplete)
before or after the objBrowser.navigate
but doesn't seem to work too. How can I ensure that page is fully loaded before the script runs?
Test your theory by adding a custom sleep for a specific time with objBrowser.sleep. If it works with the sleep to input the search box then your theory is correct.
I added objBrowser.sleep(2) after the navigate, it works now. Thanks!
I see. In that case there is a dynamic wait function that is even better for your case. You can use the .onExist method of an element to wait until it appears. Something like this: objBrowser.getElementByQuery(...).on Exist.value = (...)
.onExist works perfectly! Thanks!
I have this issue where I opened edge browser and navigate to google.com to fill in value in the search field but the field remains empty.
objBrowser.navigate ("https://google com"), isInteractive objBrowser.getElementByQuery("[name='q']").value = "automate edge vba"
Here is the error log: varID 29817 = document.querySelector ("[name='q']") | Returned: null varID 29817.value="automate edge vba" | Returned: TypeError: Cannot set properties of null
This happened when I worked on my company laptop, however it works fine on my personal laptop. What do you suggest that I can do to troubleshoot?