@WolfBeasty
debb177d-e5c6-4cbe-b258-d062dc72d14e-image.png
5b1963d1-3958-40e2-af4e-41ef5ddd0f13-image.png
For cancelling number you can use this.
67601751-1314-480a-a706-dbeec4f1d10a-image.png
795be0b7-9a11-40b3-8094-4f04a4bd1423-image.png
When using this you should also use the right status.
02ccb839-6d12-43e8-83bb-f2f6b4b1cd30-image.png
What is Execute Javascript on Element?
-
Hi
Sorry I might flood this place with questions for a few days but once I am up to speed, I will help others out too
I found this on the Russian Forum, what are the use cases for Execute Javascript on Element? as opposed to execute Javascript
Does this method return html elements, say my query was >>CSS >> .example
Which has 3 instances, does it do something like a forEach method?http://community.bablosoft.com/uploads/files/1493408088039-changelistsize.xml
-
what are the use cases for Execute Javascript on Element?
Execute Javascript on ElementandJavascriptit almost the same, they executes js in browser context. ButExecute Javascript on Elementalso exposes self variable. It holds reference for found element.For example to remove element you should call:
self.parentNode.removeChild(self);The value returned by this function is the value of exression converted to string
For example
2+2returns4self.valuereturns actual edit box value from html pageself.getAttribute("href")may return link urlThe expression may contain variables from BAS context, so
var index = [[CYCLE_INDEX]]; document.querySelectorAll("a")[index].getAttribute("href")Will return url from link with index [[CYCLE_INDEX]]
Here is example project on how to parse all links with
Execute Javascript on Element, but of course, much better way is to use xpath.