|
|
|
A much simplified version of the test file is attached as selenium_border_bug_simple.html.
There appear to be two bugs: one in Firefox and one in Selenium. Firstly, remove the "overflow: hidden" from the outer div. The offsetLeft and offsetTop of the inner div is 0, 0 (viewed in Firebug). The position of the inner div should be left = 140, top = 110. However, Selenium calculates it as 100, 100. In other words, the border width of the outer div is not taken into account. # [info] Executing: |assertElementPositionLeft | //div[text()="Expired"] | 140 | # [error] Actual value '100' did not match '140' # [info] Executing: |assertElementPositionTop | //div[text()="Expired"] | 110 | # [error] Actual value '100' did not match '110' Secondly, test with the file as uploaded (i.e. reinstate "overflow: hidden"). The inner html element now has offsetLeft of -40 and offsetTop of -10 (viewed in Firebug) . This appears to be a Firefox bug. It means the calculation of inner div position is way out on Selenium now as it isn't taking into account the border OR the buggy offsetLeft/offsetTop. # [info] Executing: |assertElementPositionLeft | //div[text()="Expired"] | 140 | # [error] Actual value '60' did not match '140' # [info] Executing: |assertElementPositionTop | //div[text()="Expired"] | 110 | # [error] Actual value '90' did not match '110' Hugh Note that Firefox 3.0.1 fixes the negative offsetLeft issue. The problem with border width not being taken into account in Selenium remains.
Hugh |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<tr>
<td>assertElementPositionLeft</td>
<td>//div[text()="Expired"]</td>
<td>140</td>
</tr>
<tr>
<td>assertElementPositionTop</td>
<td>//div[text()="Expired"]</td>
<td>110</td>
</tr>
Result:
# [info] Executing: |assertElementPositionLeft | //div[text()="Expired"] | 140 |
# [error] Actual value '60' did not match '140'
# [info] Executing: |assertElementPositionTop | //div[text()="Expired"] | 110 |
# [error] Actual value '91' did not match '110'
The left and top position of the div with content "Expired" are way out.
Hugh