selenium isVisible method not working as expected -


i opening page http://www.ebay.com/itm/apple-iphone-5-16gb-white-silver-factory-unlocked-/151097083750?pt=cell_phones&hash=item232e168766

and checking see if blue ribbon visible mentioned in image enter image description here

here test

<tr>     <td>open</td>     <td>/itm/apple-iphone-5-16gb-white-silver-factory-unlocked-/151097083750?pt=cell_phones&amp;hash=item232e168766</td>     <td></td> </tr> <tr>     <td>isvisible</td>     <td>//div[@class='vi-notify-msg']</td>     <td></td> </tr> 

and expecting fail surprisingly passes every time...what missing here?

edit:

i expecting test fail because ribbon takes time appear after page loaded , command isvisible executed before ribbon visible..so should fail right?

if @ html, element there page loads. it's styled fade in after page finishes loading, html perspective, it's "visible" entire time page loading:

as page loaded:

<div id="vi_notification" class="vi-notify-cmp" style="top:25%;">     <div class="vi-notify-container vi-notify-shadow">         <div class="vi-notify-icon vi-notify-icon-img"></div>         <div class="vi-notify-msg">28 people viewing item per hour.</div>         <div class="vi-notify-close">             <button id="vi_notification_cls_btn" class="vi-notify-   close-btn">x</button>         </div>     </div> </div> 

only after fades out styling change display:none:

<div id="vi_notification" class="vi-notify-cmp" style="top: 25%; left: 10px; display: none;">     <div class="vi-notify-container vi-notify-shadow">         <div class="vi-notify-icon vi-notify-icon-img"></div>     <div class="vi-notify-msg">28 people viewing item per hour.</div>     <div class="vi-notify-close">             <button id="vi_notification_cls_btn" class="vi-notify-close-btn">x</button>         </div>     </div> </div> 

if @ element loads using chrome developer toolbar, you'll see "visible", styling updates fade in our human eyes can see it.

this means when page loading / loaded, element return displayed. after fades out, expect displayed return false, since styling on parent div changed display:none.


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -