I tried all the methods below, they work:
1. $ie.link(:after?, $ie.image(:title, "Photogallerysanity1")).click
2. $ie.link(:after?, $ie.image(:alt, "Photogallerysanity1")).click
3. $ie.link(:after?, $ie.image(:src, /s3.amazonaws.com
\/staging-brandpotion-prints/)).click
4. $ie.image(:alt, "Photogallerysanity1").parent.link(:index, 1).click
5. $ie.image(:alt, "Photogallerysanity1").parent.link(:text, "Edit").click
6. $ie.image(:alt, "Photogallerysanity1").parent.link(:class => "underline",
:index =>1).click

We don't need use Xpth here.

Thanks.
Wesley Chen.
For life, the easier, the better.


2009/10/23 Amit Kulkarni <amitkkulkarni...@gmail.com>

> Thanks for the help.
> Following is the page source.
>
>  <body>
>         <div class="main"> <!-- main -->
>
>             <div class="header-container"> <!-- header -->
>                 <div class="header">
>
>       <div class="actions">
>       welcome <a href="/profile/nikeman" alt="nikeman" class="underline" 
> onclick="window.open(this.href);return false;" title="nikeman">nikeman</a> 
> &nbsp;&nbsp;&nbsp;
>
>       </div>
>        </div>
>
>         </div> <!-- header close -->
>
>             <div class="content-container"> <!-- content -->
>
>
>                 <div class="content">
>               <h2 class="title">Nikes Active features</h2>
>
>               <div class="tab-layout">
>               <li class="selected"><span class="">Photogallery</span></li>
>
>               </ul>
>
>                        <div class="tab-content">
>
>                              <strong class="alert"></strong>
>                               <form 
> action="/Nikes/photo_gallery/attachments/delete_multiple" method="post">
>
>                               <div class="dark-underlined-cont">
>                                        <h3>Photogallery</h3>
>
>                                </div>
>                                 <div class="arrow-bar borded">
>
>                                       <div>
>                                         <input type="submit" class="submit 
> ar-normal" title="Delete selected" value="Delete selected" 
> onclick="if(!validate_delete('input'))  { alert('Please select a photo'); 
> return false;} " />
>                                         <a 
> href="/Nikes/photo_gallery/attachments/new?media=print" class="ar-normal" 
> title="Add new photo">Add new photo</a></li>
>
>                                        </div>
>                                 </div>
>                                 <div class="gallery">
>                                       *
> <div style="width:150px;height:150px;">
>                                           <input id="attachment[218]" 
> name="attachment[218]" type="checkbox" value="1" />
>
>                                           <img alt="Photogallerysanity1" 
> src="http://s3.amazonaws.com/staging-brandpotion-prints/images/63/large_thumb.jpg";
>  title="Photogallerysanity1" />
> *
>
> *                                          <a 
> href="/Nikes/photo_gallery/attachments/218/edit?media=print" 
> class="underline">Edit</a> *
>                                        </div><!-- just for hidden the margin 
> of the last element -->                               </div>
>
>                             </form> <!-- end form -->
>                               </div>
>                         <div class="clear"></div> <!-- clearing content 
> floats important! -->
>
>
>                 </div>
>             </div> <!-- content close -->
>
>         </div> <!-- main close -->
>     </body>
>
> </html>
>
>
>
>
> 2009/10/23 Wesley Chen <cjq....@gmail.com>
>
> Your this question has taken so much time.
>> I think you still have not described your question clearly enough.
>>
>> For the html code you provided, of course it is easy for us to help you to
>> locate.
>>
>> Please give us the whole page source you failed to locate, and show the
>> error message you got.
>>
>>
>> Thanks.
>> Wesley Chen.
>> For life, the easier, the better.
>>
>>
>> 2009/10/22 Amit Kulkarni <amitkkulkarni...@gmail.com>
>>
>> Hi Angrez,
>>> I tried with the link you provided but it shows below error
>>>
>>> Unable to locate element, using :xpath,
>>> "//i...@title='Photogallerysanity']/"
>>> (Watir::Exception::UnknownObjectException)
>>> Same error appears when i use .click or .flash
>>>
>>>
>>> On Thu, Oct 22, 2009 at 5:14 PM, Angrez Singh <ang...@gmail.com> wrote:
>>>
>>>> can you try this?
>>>> Browser.link(:xpath,"//i...@title='Photogallerysanity']/a").flash() or
>>>> click()
>>>>
>>>> - Angrez
>>>>
>>>> On Thu, Oct 22, 2009 at 5:03 PM, Amit Kulkarni <
>>>> amitkkulkarni...@gmail.com> wrote:
>>>>
>>>>> I also tried to use using Xpath. i.e.
>>>>> Browser.link(:xpath,"//a...@href='/Nikes/photo_gallery/attachments/218/edit?media=print']/").text
>>>>> # =>  "Edit"
>>>>>
>>>>> Still no success.Is there something wrong with the above code?
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Oct 22, 2009 at 4:55 PM, Amit Kulkarni <
>>>>> amitkkulkarni...@gmail.com> wrote:
>>>>>
>>>>>> Sorry again,
>>>>>> Yes i read the tutorial.
>>>>>> I tried some stunts but no success.So posted my queries here.
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 22, 2009 at 4:48 PM, Željko Filipin <
>>>>>> zeljko.fili...@wa-research.ch> wrote:
>>>>>>
>>>>>>> On Thu, Oct 22, 2009 at 12:47 PM, Željko Filipin <
>>>>>>> zeljko.fili...@wa-research.ch> wrote:
>>>>>>> > Have you read the tutorial?
>>>>>>> > http://wiki.openqa.org/display/WTR/Tutorial
>>>>>>>
>>>>>>> You did not answer this.
>>>>>>>
>>>>>>>
>>>>>>> Željko
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to