On Tuesday, March 13, 2012 8:40:21 PM UTC-7, Joe Fl wrote:
>
> Hi, 
>
> I need to confirm this tag [a class="person-inline-profile "] is 
> available to know the image is clickable.  I have included the html 
> code below. 
>
> I have tried the following and returns as 'false'. 
>
> @browser.div(:id,"activity_stream_container").li(:class,'item').a(:class,'person-
>  
>
> inline-profile').img(:alt,'jen QA tester, MD').exists? 
>
> <div id="activity_stream_container" class="inner"> 
> <div class="hd"> 
> <ul class="items"> 
> <li class="item"> 
> <a class="person-inline-profile " title="Association CDK Sandbox" 
> href="https://my-staging.within3.com/profiles/40628/show_other_person? 
> default_link=summary<https://my-staging.within3.com/profiles/40628/show_other_person?default_link=summary>">
>  
>
> <img class="thumb img" src="https://images-staging.within3.com/images/ 
> profile_pics/profile_photo_default.jpg?1331604357<https://images-staging.within3.com/images/profile_pics/profile_photo_default.jpg?1331604357>"
>  
> alt="jen QA tester, 
> MD"> 
> </a> 
>
> * This is the image below the above that is not clickable. 
>
> <div class="bd"> 
> </li> 
> <li class="item"> 
> <img class="thumb img" src="https://my-staging.within3.com/ 
> profile_photos/10129_2_small.jpg?1326122546<https://my-staging.within3.com/profile_photos/10129_2_small.jpg?1326122546>"
>  
> alt="Kimberly Cerri"> 
> <div class="bd"> 
> </li> 
>
> Any help would be greatly appreciated..... 
>
> Thank you, 
> Joe


Reading between the lines, it sounds like you have a list of  li (List 
Item) elements which wrap around an image, and possibly a link if the thing 
is supposed to be able to be clicked.   In that case since you know the 
path to the outer container, why not just check to see if a link .exists? 

     
    
@browser.div(:id,"activity_stream_container").li(:class,'item').a.exists?

If you need to parse through all of those list items then perhaps try 

   @browser.div(:id,"activity_stream_container").lis(:class,'item').each do 
|item|
      if item.a.exists? 
        #code for what to do about the link being there
      else
        #code for what to do if the link is not there. 
      end
     end

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to