[Wtr-general] How to discover and address items within nested frames.
I have a web app that consists of multiple nested frames and, for the most part, show_all_objects works just fine for discovering how to navigate the frames and address the individual elements. However, there are some places where I just can't figure out how to access the items present and so I am hoping that you more knowledgable people will be nice enough to tell me the best three or four ways to do this. brbr 1) In general, what are good techniques to use to itemize and discover objects? I've read the supplied documentation but it doesn't go far enough to solve my particular environmental problems so if someone could tell me a few of their own tricks for discovering how to address objects, I'd be most grateful. brbr 2) In this particular case, the frame contains a number of combo boxes and links that look like buttons. I need to be able to select various items in the combos and click on the links. How can I do this? brbr Here's what Watir sees when it looks into this particular troublesome frame: br ie.frame(:name, frame3).frame(:name, frame4).show_all_objects br returns br br ---Objects in page - br id= src= br HTML Document name=tframe1id= src=transactions_header.asp?FeatureMeasureID=MeasureType= br HTML Document name=tframe2id= src=transactions_table_frameset.asp?days=0fromdate=todate=type=Feature br MeasureID=MeasureType= br br If I right click on the troublesome frame and view source I get something like this: br br /html br bunch of javascript functions snipped for brevity br body align=left marginwidth=0 marginheight=0 topmargin=0 leftmargin=0 br form name=transactions br input type=hidden name=featureMeasureID value= br input type=hidden name=measureType value= br table WIDTH=100% ALIGN=left BORDER=0 CELLSPACING=0 CELLPADDING=0 br tr br tda NAME=top/a br table border=0 cellPadding=0 cellSpacing=0 width=100% align=left br tr br td width=125 br pFrom: br SELECT STYLE=font:normal normal normal 8pt NAME=fromdate id=fromdate SIZE=1!--onChange=changeDays(this.value)-- br OPTION VALUE=0Today br OPTION VALUE=1 TARGET=_selfSeptember 7 br OPTION VALUE=2 TARGET=_selfAugust 31 br OPTION VALUE=3 TARGET=_selfAugust 24 br OPTION VALUE=4 TARGET=_selfAugust 17 br OPTION VALUE=5 TARGET=_selfAugust 10 br /SELECT br /p br /td br td width=115 br p To: br SELECT NAME=todate id=todate SIZE=1 br OPTION VALUE=0Today br OPTION VALUE=1 TARGET=_selfSeptember 7 br OPTION VALUE=2 TARGET=_selfAugust 31 br OPTION VALUE=3 TARGET=_selfAugust 24 br OPTION VALUE=4 TARGET=_selfAugust 17 br OPTION VALUE=5 TARGET=_selfAugust 10 br OPTION VALUE=6 TARGET=_selfAll (45 Days) br /SELECT/font br /p br /td br td width=150 br pType: br SELECT NAME=transactiontype id=transactiontype SIZE=1 onChange=checkOptions(this); br OPTION VALUE=0 TARGET=_selfAll br OPTION VALUE=1 TARGET=_selfCalls br OPTION VALUE=2 TARGET=_selfAdjustments br OPTION VALUE=3 TARGET=_selfReplenishments br !--OPTION VALUE=4 TARGET=_selfPurchases -- br !--OPTION VALUE=5 TARGET=_selfTransfers -- br /SELECT br /td br td width=130 br note altered the href tags because they would not display properly in this newsgroup message otherwise/note br a href= onclick=Validate(); return false;im-g src=../images/retrieve_but.gif border=0 width=83 height=17/a br /td br td width=300 align=left br a href= onclick=displayAddCredit(); return false;im-g src=../images/credit_button.gif border=0 width=83 height=17/a br a href= onclick=displayAddDebit(); return false;im-g src=../images/debit_button.gif border=0 width=83 height=17/a br a href= onclick=displayAddReplenish(); return false;im-g src=../images/replenish_but.gif border=0 width=83 height=17/a br /td br /tr br /table br /td br /tr br /table br /form br /body br /html - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=4031messageID=11068#11068 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How to discover and address items within nested frames.
Ah, here's a tip. Use the 'html' function to get the string that Watir sees. Once that is present then things become much clearer. In the previous example, it now becomes obvious what was wrong and how to address the 'fromdate' combo. brbr puts ie.frame(:name, frame3).frame(:name, frame4).frame(:name, tframe1).html br ie.frame(:name, frame3).frame(:name, frame4).frame(:name, tframe1).select_list(:name, fromdate).flash brbr However, I'd still be grateful for further tips from those of you who know so much more than I about how to discover who to navigate about framed ASP pages. - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=4031messageID=11077#11077 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Navigating in IE frames
Yes, the frame itself must be dereferenced. Example: Multiple nested frames and a hyper link to be clicked. ie.frame(:name, frame3).frame(:name, frame3).link(:index, 1).click - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3459messageID=11025#11025 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general