now this is getting really weird.
I do a show_frames and it gives me names of 3 frames.
when i used the comman you suggested.
ie.frame(:name, ['toc']).cell(:text, /Areas/).click ..
it simply denies that the frame exists?
In the code the frames are defined in the main menu as
<frameset rows="50px,*" cols="*" frameborder="NO" border="0"
framespacing="0" >
<frame scrolling="NO" noresize src="TopLogo.html "
name="top"
id="top" >
<frameset cols="152px,*" frameborder="NO" border="0"
framespacing="0" id="mainframeset">
<frame scrolling="NO" noresize
src="SideMenu.htm" name="toc"
>
<frame src=" WelcomeMsg.html"
name="content" scrolling="NO">
</frameset>
</frameset>
i am trying to access cell 'Areas And Branches' from SideMenu.htm
which is in frameset named 'toc'
here is the error
Started
there are 3 frames
frame index: 1 name: top
frame index: 2 name: toc
frame index: 3 name: content
E
Finished in 1.734 seconds.
1) Error:
test_TCrecorded(TCrecorded):
Watir::Exception::UnknownFrameException: Unable to locate a frame with
name toc
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/frame.rb:
40:in `locate'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/frame.rb:
47:in `initial
ize'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:
102:in `ne
w'
C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/container.rb:
102:in `fr
ame'
On Sep 8, 8:25 pm, Angrez Singh <[email protected]> wrote:
> try ie.frame(:name, [frame name]).cell(:text, /Areas/).click
>
> - Angrez
>
>
>
> On Tue, Sep 8, 2009 at 7:17 PM, rs77 <[email protected]> wrote:
>
> > yes , its in a frame toc
> > the whole page has 3 frames
> > top frame
> > toc frame - sidemenu.htm (where Areas and Branches is a cell) and
> > content frame...which has further htm pages.
>
> > On Sep 8, 6:38 pm, Angrez Singh <[email protected]> wrote:
> > > Is this cell is inside a frame?
>
> > > 2009/9/8 rs77 <[email protected]>
>
> > > > here is the html code
>
> > > > <body topmargin="5" leftmargin="3" onLoad="loadDefaultMenu();"
> > > > onkeydown="keydowncheck();">
> > > > <!-- Main Menu -->
> > > > <table width="100%" border="0" cellpadding="0"
> > > > cellspacing="0"><!-- Originally there was no height -->
> > > > <!--DWLayoutTable-->
> > > > <!-- Tabs -->
> > > > <tr>
>
> > > > <td width="25" height="32" colspan="2" valign="top"><a
> > > > href="#" onClick=""><img id="Pic1" src="./images/menuWindow/tabs/
> > > > 1.jpg_selected.jpg" width="30" height="32" title="Self Drive"></a></
> > > > td>
> > > > <td width="25" valign="top"><a href="#"
> > > > onClick=""><img id="Pic2" src="./images/menuWindow/tabs/2.jpg"
> > > > width="30" height="32" title="Chauffeur"></a></td>
> > > > <td width="25" valign="top"><a href="#"
> > > > onClick=""><img id="Pic3" src="./images/menuWindow/tabs/3.jpg"
> > > > width="30" height="32" title="Cashier"></a></td>
> > > > <td width="25" valign="top"><a href="#"
> > > > onClick=""><img id="Pic4" src="./images/menuWindow/tabs/4.jpg"
> > > > width="30" height="32" title="Foreign"></a></td>
> > > > <td
> > > > width="25" valign="top"><a href="#" onClick=""><img
> > > > id="Pic5" src="./images/menuWindow/tabs/4.jpg" width="30"
> > > > height="32" title="SetUp"></a></td>
> > > > </tr>
> > > > <!-- End Tabs -->
> > > > <!-- User Info Section -->
> > > > <tr>
> > > > <td width="9" valign="top" background="./images/
> > > > menuWindow/main_menu_left_border.jpg" style="background-repeat:repeat-
> > > > y "><!--DWLayoutEmptyCell--> </td>
> > > > <td height="25" colspan="5" valign="top"
> > > > class="menuDivider"> SUPERVISOR Supervisor</td>
> > > > <td width="9" background="./images/menuWindow/
> > > > main_menu_rigth_border.jpg" style="background-repeat:repeat-y
> > > > "> </td>
> > > > </tr>
> > > > <!-- End User Info -->
> > > > <tr>
> > > > <td valign="top" background="./images/menuWindow/
> > > > main_menu_left_border.jpg" style="background-repeat:repeat-y "><!--
> > > > DWLayoutEmptyCell--> </td>
> > > > <td colspan="5" height="569" valign="top"
> > > > background="./images/menuWindow/menu_layer_bg.jpg">
> > > > <!-- Originally Height=410 -->
> > > > <!-- Tab1 Menu -->
> > > > <div id="Menu1" style="visibility:hidden;
> > > > position:absolute; top:64px ">
> > > > <table width="100%" border="0" cellpadding="0"
> > > > cellspacing="0" style="behavior:url(./styles/tablehl.htc);background-
> > > > color:#dededc; " slcolor=#8297C4 hlcolor=#8297c4 >
> > > > <!--DWLayoutTable-->
> > > > <!-- Menu Table 2 -->
> > > > <!-- Menu Header-->
> > > > <thead>
> > > > <tr class="menuHeader">
> > > > <td width="15" height="18" valign="top">
> > > > <img src="./images/general/white_on_light_blue_bullet.jpg"></td>
> > > > <td width="118" valign="top" > SetUp</td>
> > > > <td width="10" background="./images/menuWindow/
> > > > menu_top_shadow.jpg" style="background-repeat:repeat-y "></td>
> > > > </tr>
> > > > </thead>
> > > > <!-- End Menu Header-->
> > > > <!-- Menu Entries-->
> > > > <tr class="menuEntry1" ><!-- Enter here
> > > > class="menuEntry" ONMOUSEOVER="this.runtimeStyle.background =
> > > > '8297c4';" onmouseout="this.runtimeStyle.background= 'dededc';"-->
> > > > <td valign="top"><!--DWLayoutEmptyCell--> </
> > > > td>
> > > > <td height="18" valign="top"
> > > > onclick="parent.content.location.href='MainMenu.jmp?pid=97&pName=Areas
> > > > And Branches'" style="cursor:hand" > Areas And Branches</td>
> > > > <td background="./images/menuWindow/
> > > > menu_side_shadow.jpg" style="background-repeat:repeat-y "></td>
> > > > </tr>
>
> > > > On Sep 8, 5:53 pm, Angrez Singh <[email protected]> wrote:
> > > > > can you post the full html over here? Is this cell inside the frame?
>
> > > > > On Tue, Sep 8, 2009 at 5:55 PM, rs77 <[email protected]> wrote:
>
> > > > > > these dont seem to work either!!!!
> > > > > > **********************************************
> > > > > > Using ie.cell(:text, /Areas And Branches/).click
> > > > > > **********************************************
> > > > > > E
> > > > > > Finished in 1.734 seconds.
>
> > > > > > 1) Error:
> > > > > > test_TCrecorded(TCrecorded):
> > > > > > Watir::Exception::UnknownObjectException: Unable to locate element,
> > > > > > using :text,
> > > > > > /Areas And Branches/
>
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > 52:in `asser
> > > > > > t_exists'
> > > > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > 284:in `enab
> > > > > > led?'
> > > > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > 56:in `asser
> > > > > > t_enabled'
> > > > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > 229:in `clic
> > > > > > k!'
> > > > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > 215:in `clic
> > > > > > k'
> > > > > > D:/Installers/watir/experimenting/JMP_CreateBranch.rb:54:in
> > > > > > `test_TCrecorded
>
> > > > > > -----------------------------
>
> > > > > > and when used (changed the double quotes to single around areas and
> > > > > > branches as it was giving a syntax error)
> > > > > > ie.element_by_xpath("//td[contains(.,'Areas And Branches')]").click
> > > > > > 1) Error:
> > > > > > test_TCrecorded(TCrecorded):
> > > > > > NoMethodError: undefined method `click' for nil:NilClass
> > > > > > D:/Installers/watir/experimenting/JMP_CreateBranch.rb:50:in
> > > > > > `test_TCrecorded
> > > > > > '
>
> > > > > > 1 tests, 0 assertions, 0 failures, 1 errors
>
> > > > > > On Sep 8, 5:10 pm, Angrez Singh <[email protected]> wrote:
> > > > > > > does this works:
> > > > > > > ie.cell(:text, /Areas And Branches/).click
>
> > > > > > > or this:
> > > > > > > ie.element_by_xpath("//td[contains(., "Areas And
> > Branches")]").click
>
> > > > > > > - Angrez
>
> > > > > > > On Tue, Sep 8, 2009 at 5:03 PM, rs77 <[email protected]>
> > wrote:
>
> > > > > > > > still no luck :(
>
> > > > > > > > 1) Error:
> > > > > > > > test_TCrecorded(TCrecorded):
> > > > > > > > NoMethodError: undefined method `element_by_xpath' for
> > > > #<Watir::Frame:
> > > > > > > > 0x2e55054>
>
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/table.rb:
> > > > > > > > 324:in `locate'
>
> > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > > > 49:in `assert_exists'
>
> > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > > > 284:in `enabled?'
>
> > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > > > 56:in `assert_enabled'
>
> > > > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > > > 229:in `click!'
>
> > C:/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.2/lib/watir/element.rb:
> > > > > > > > 215:in `click!'
>
> > > > > > > > Am i missing something basic, do i need to require anything
> > else
> > > > for
> > > > > > > > using xpath?
>
> > > > > > > > On Sep 8, 4:24 pm, Željko Filipin <
> > [email protected]>
> > > > > > > > wrote:
> > > > > > > > >http://wiki.openqa.org/display/WTR/XPathsays:
>
> > > > > > > > > "you can access frames using the attributes that Watir
> > provides
> > > > but
> > > > > > you
> > > > > > > > > can't use xpath attribute for accessing frames"
>
> > > > > > > > > Try this:
>
> > > > > > > > > browser.frame(:index, 3).cell(:xpath, "//td[contains(@onclick
> > ,
> > > > > > > > > 'MainMenu.jmp?pid=97&pName=Areas And Branches')]").click
>
> > > > > > > > > Željko- Hide quoted text -
>
> > > > > > > - Show quoted text -- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To post to this group, send email to [email protected]
Before posting, please read the following guidelines:
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---