findElements in Recorder

storeEval this.browserbot.findElements(By.xpath("//a[@class=“FullName”]")) elem
does: [error] Threw an exception: missing ) after argument list

How can i create array of elements to get all href value?

Thank you for using our product. You can query elements with
storeEval | selenium.browserbot.findElement(‘a[@class=“FullName”]’)

Although, the easiest way is to use jQuery.

storeEval | var h = []; $(‘a’).each(function() { h.push($(this).attr(‘href’)); });h; | h
echo | ${h}


Thank you for your answers.
I searchedexample like this very hard and found finally )

Second way is comact and intense. There’s many things to research.

$(‘a’) is object of element
each - jQuery
noname function
push - stores next element of array
$(this) - current object of element…
attr to array

Is last “;h;” mistake ?

Thanks again.

1 Like

Hi. In JavaScript “eval” will return the value of the last expression. That’s why we need “;h;”.

1 Like