My code is such that before firing an ajax request, the table row has opacity 0.5 and once the ajax request is completed the opacity is 1
I am using the opacity of a table row in waitForCondition method to check if the ajax request has completed loading. The code is not working, it timesout every time. I have checked the values of opacity before and after the waitForCondition and the values returned are correct but still it is timing out.
the code which i have used is like this
<tr>
<td>echo</td>
<td>javascript{selenium.browserbot.getCurrentWindow().document.getElementsByTagName('tbody')[0].getElementsByTagName('tr')[0].style.opacity}</td>
<td></td>
</tr>
<tr>
<td>waitForCondition</td>
<td>javascript{selenium.browserbot.getCurrentWindow().document.getElementsByTagName('tbody')[0].getElementsByTagName('tr')[0].style.opacity == 1}</td>
<td>30000</td>
</tr>
<tr>
<td>echo</td>
<td>javascript{selenium.browserbot.getCurrentWindow().document.getElementsByTagName('tbody')[0].getElementsByTagName('tr')[0].style.opacity}</td>
<td></td>
</tr>
I have got the solution for my issue.
I didnt needed to use the javascript{} construct in waitForCondition, since this method implicitly considers that we are giving a javascript to this method.
So, the correct expression is: