I need to know how many links or buttons with particular properties page displays. I do not need a unique object to performa an action on. I just need a number, preferably fast. If I use following JavaScript as ID Method:
evalXPath("//ul[@class=\"some-list\"]/li[@some-status='THE STATUS I AM LOOKING FOR']");
then "Evaluate Java Script Code" Fails immediately with ** 7: Evaluate JavaScript code var SuitableLinks = ev... FOR']"); ** failed - exception occurred: ReferenceError: evalXPath is not defined
"Evaluate JS on Object" Spends time "Waiting For Object" then returns:
** 7: Evaluate JavaScript [Code] on SuitableLinks link ** failed - target object was not found.
I can force "Evaluate JS on Object" to give me what I want by changing JavaScript to:
var SuitableLinks = evalXPath("//ul[@class=\"some-list\"]/li[@some-status='THE STATUS I AM LOOKING FOR']"); ArgsContext.item = SuitableLinks.length;
but it still wastes time "Waiting For Object", and it still fails, so I have to use "Catch Any error" and then use Log option "Do not report errors caught by 'Catch Errors' step". I want a better solution.
Is there really no way to count objects?
Do I need to write my own JavaScript function for this?