문제

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?

도움이 되었습니까?

해결책

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);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top