Frames

2 views
Skip to first unread message

Thomas Roßberg

unread,
Feb 11, 2009, 7:49:50 AM2/11/09
to tellurium-users
Hello,

do you imagine the followed description: Frame A ist the topframe of
any page. There are two child frames in this frame (Frame A), called
Frame B and Frame C. The frame, Frame C, has got a inline frame
(iframe) with its name "centerFrame". I want to test through the
frames. All Frames are defined in UI module, e.g.:

ui.Frame(uid: "Frame A, name: "Frame A)
...

Steps:
1. open any page
2. select Frame A (selectFrame "Frame A")
3. do any test
4. select Frame C (selectFrame "Frame C")
5. do any test
6. select inline frame (selectFrame "centerFrame")
7. do any test
8. I want go back to Frame C. The fittest locator is "relative=up" or
"relative=parent". But Tellurium threw an error: "Error: cannot find
the top object relative=up"

Greetz

Thomas

John.Ji...@gmail.com

unread,
Feb 11, 2009, 9:34:28 AM2/11/09
to tellurium-users
Hi Thomas,

The Tellurium Frame object provides two methods:

void selectParentFrame(Closure c){
c("relative=parent")
}

void selectTopFrame(Closure c){
c("relative=top")
}

That is to say, Tellurium uses selectParentFrame to go back to the
parent frame
and selectTopFrame to go back to the top frame. In DslContext, the
methods that users
should use are as follows,

def selectParentFrameFrom(String uid) {
WorkflowContext context = WorkflowContext.getDefaultContext()
ui.walkTo(context, uid)?.selectParentFrame() {String loc ->
eventHandler.selectFrame(loc)
}
}

def selectTopFrameFrom(String uid) {
WorkflowContext context = WorkflowContext.getDefaultContext()
ui.walkTo(context, uid)?.selectTopFrame() {String loc ->
eventHandler.selectFrame(loc)
}
}

i.e., you should use "selectParentFrameFrom frame_name" and
"selectTopFrameFrom frame_name"
in your UI module.

Have you tried them?

Thanks,

Jian

Thomas Roßberg

unread,
Feb 11, 2009, 9:50:05 AM2/11/09
to tellurium-users
Hello Jian,

it works well. Thanks.

I think that both methods (selectParentFrameFrom and
selectTopFrameFrom) should be posted in the Tellurium APIs (Tellurium
User Guide), because there's written: "Tellurium APIs include all
methods defined in DslContext".

Greetz

Thomas

John.Ji...@gmail.com

unread,
Feb 11, 2009, 10:08:50 AM2/11/09
to tellurium-users
Thanks for your suggestion, I will update the user guide soon.

Thanks,

Jian
Reply all
Reply to author
Forward
0 new messages