# Clicking web page tab

**URL:** <https://rubytalk.org/t/clicking-web-page-tab/31196>\
**Category:** ruby-talk\
**Created:** [21 September 2006 11:35 UTC](https://rubytalk.org/t/clicking-web-page-tab/31196 "2006-09-21T11:35:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![newyorkdolluk](https://avatars.discourse-cdn.com/v4/letter/n/0ea827/32.png) [@newyorkdolluk](https://rubytalk.org/u/newyorkdolluk)\
**Post date:** [21 September 2006 11:35 UTC](https://rubytalk.org/t/clicking-web-page-tab/31196/1 "2006-09-21T11:35:11Z")

</div>

i have a tab on a web page that i want watir/ruby to click.

the DOM has it down as:

\<HTML\>  
...  
...  
&nbsp;&nbsp;\<Frame Id=topMenu\>  
&nbsp;&nbsp;&nbsp;&nbsp;\<FORM id =Form1\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TABLE class=tblbg\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TD id=tabWrap\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<DIV class=admin id=header\>  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<LI id=nav-plan\>

can anyone suggest a ruby/watir command to simulate the click

cheers

---

<div class="post-metadata">

**Author:** ![alex\_f\_il](https://avatars.discourse-cdn.com/v4/letter/a/2bfe46/32.png) [@alex\_f\_il](https://rubytalk.org/u/alex_f_il)\
**Post date:** [22 September 2006 13:40 UTC](https://rubytalk.org/t/clicking-web-page-tab/31196/2 "2006-09-22T13:40:13Z")

</div>

You can try SWExplorerAutomation (SWEA) from  
http:\\webunittesting.com. With SWEA you don't need to dig into the  
DOM structure. SWEA is .Net API, but you can call it from RUBY.NET

newyorkdolluk wrote:

> **···**
>
> > i have a tab on a web page that i want watir/ruby to click.
> > 
> > the DOM has it down as:
> > 
> > \<HTML\>  
> > ...  
> > ...  
> > &nbsp;&nbsp;\<Frame Id=topMenu\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;\<FORM id =Form1\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TABLE class=tblbg\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TD id=tabWrap\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<DIV class=admin id=header\>  
> > &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<LI id=nav-plan\>
> > 
> > can anyone suggest a ruby/watir command to simulate the click
> > 
> > cheers

---

<div class="post-metadata">

**Author:** ![Bret\_Pettichord](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@Bret\_Pettichord](https://rubytalk.org/u/Bret_Pettichord)\
**Post date:** [26 September 2006 08:45 UTC](https://rubytalk.org/t/clicking-web-page-tab/31196/3 "2006-09-26T08:45:11Z")

</div>

newyorkdolluk wrote:

> i have a tab on a web page that i want watir/ruby to click.
> 
> the DOM has it down as:
> 
> \<HTML\>  
> ...  
> ...  
> &nbsp;&nbsp;\<Frame Id=topMenu\>  
> &nbsp;&nbsp;&nbsp;&nbsp;\<FORM id =Form1\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TABLE class=tblbg\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<TD id=tabWrap\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<DIV class=admin id=header\>  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\<LI id=nav-plan\>
> 
> can anyone suggest a ruby/watir command to simulate the click

ie.frame(:id, 'topMenu').div(:id, 'header').click

Watir requires you to specify frames. Other elements are optional,  
except to avoid ambiguity.

Bret
