Question

I have some Selenium tests I've been building with the Firefox IDE plugin. This is the first I've attempted tests like this, the client asked for it, as I'm refactoring some code and they want to be certain things still work.

I have an element that resizes via a script, and I need to test its height. My Selenium source currently looks something like:

<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">New Test</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>/landing-page</td>
    <td></td>
</tr>
<tr>
    <td>click</td>
    <td>css=a.facebook.</td>
    <td></td>
</tr>
</tbody></table>

I need to test that an element is greater than a certain height. How do I write that in after clicking on the .facebook link?

Was it helpful?

Solution

There is not a vanilla way of doing such a thing. You'd have to create your own javascript plugin to put into the IDE. Learn how to structure a javascript plugin for the IDE, then you can put something like this into it (mind you this is pseudo-code):

function validateHeight(HTMLElement element, int height) {
  return assertTrue(element.height == height);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top