try this,
ie.li(:id => 'test_tab_settings').click
On 15 Oct 2011, at 08:19, ash wrote:
> Hi,
>
> Below is my portion of html code.
>
> I want to click TestSettings tab.
>
> <div id="testnavigation" style="float:left;left:33px">
> <ul id="testtablist">
> <li id="test_tab_settings" class="test-current">
> <a title="testSettings" onclick="Pages.go('testdisplaySiteSettings',
> 1); return false;" href="#">
> <span id="testspan">TestSettings</span>
> </a>
> </li>
> </ul>
> </div>
>
> I tired all 3 below option.But nothing works.
>
> ie.link(:id, 'test_tab_settings').click
> ie.span(:text, 'TestSettings').click
> ie.div(:id, 'testnavigation').click
>
>
> Below is the error which i get:
>
> unable to locate element, using {:tag_na
> me=>"span", :text=>"TestSettingst"}
> (Watir::Exception::UnknownObjectException)
>
> Thanks
>
> On Oct 14, 9:07 pm, Chuck van der Linden <[email protected]> wrote:
>> If you can't share the HTML with us, and this is a commercial or OS
>> third party tab control, then the next best thing is to point us at
>> the 'examples' or 'demo' page for the control, and indicate
>> specifically which variety you are using.
>>
>> It might be easier to get your answer by moving this question to
>> StackOverflow since that venue allows for proper formatting of code
>> and HTML samples, embedding graphics, and editing both questions and
>> answers after they are posted.
>>
>> On Oct 14, 7:49 am, Tiffany Fodor <[email protected]> wrote:
>>
>>
>>
>>
>>
>>
>>
>>> Hi!
>>
>>> I agree with Zeljko, we can't give an informed answer without example
>>> html, but here are some 'stabbing in the dark' suggestions to try.
>>
>>> You may be able to click on the div, link or span more simply:
>>
>>> ie.link(:text, 'span text').click
>>> ie.span(:text, 'span text').click
>>> ie.div(:id, 'dividname').click
>>
>>> Also, we don't know what your problem is. Do you get an error message
>>> or does nothing happen?
>>
>>> If nothing happens, you may want find out if there's an associated
>>> javascript event you need to fire:
>>> ie.link(:text, 'span text').click
>>> ie.link(:text, 'span text').fireEvent('my_javascript_event')
>>
>>> I hope this helps, but if it doesn't, you'll need to provide us with
>>> some more specifics.
>>
>>> -Tiffany
>>> On Oct 14, 5:36 am, ashitha shetty <[email protected]> wrote:
>>
>>>> Hi,
>>
>>>> I am facing problem on clicking tabs.
>>
>>>> below is my code:
>>
>>>> ie.link(:id,"idname").span(:text,"span text").click
>>>> or
>>>> ie.div(:id,"dividname").span(:text, "Span text").click
>>
>>>> Any help would be appreciated.
>>
>>>> Thanks
>
> --
> Before posting, please read http://watir.com/support. In short: search before
> you ask, be nice.
>
> [email protected]
> http://groups.google.com/group/watir-general
> [email protected]
Regards,
Rahul Sharma
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]