views:

613

answers:

1

Hi, I'm new with selenium ide.. Element(82.02) is set via javascript:

<tr id="_tr_total" style=""> 
<td class="frm_preview_title"> </td> <td/> <td class="frm_preview"> 
<strong id="total_ltl" style="font-size: 12px; color: brown;"> 82.02 </strong> 
</td> </tr

how you can see, there is a value 82.02, but it's set via javascript, and when I'm looking on the page source, I don't see this value(82.02) - just html code

<strong id="total_ltl" style="font-size: 12px; color: brown;"> </strong>.

Where should be a value, is empty location. So I want to select 82.02.

Thank you.

A: 

I met the same problem with elements added dynamically to DOM by javascrit after ajax call in my case. It looks like Selenium doesn't see such elements, also notice this elements aren't in the source code of the page. You can work with these elements by calling custom javascript using selenium getEval() method.

In my case:

<input id="dynamicallyAddedInput" onclick="someThing()" />

in java client API:

selenium.isElementPresent("xpath=//input[@id='dynamicallyAddedInput']"); //false

selenium.getEval("selenium.browserbot.getCurrentWindow().document.getElementById('dynamicallyAddedInput') != null"); //true

I dont know if this is a proper solution, and will be happy for further comments.