Post by leiwang on Jun 27, 2017 3:01:35 GMT
We must define 'frame information' in the "Recognition String" if the component locates within frames.
Specify a FRAME RS for the parent container by one of following ways
(note: frame information is usually defined in parent component, but is also can be used in child component.)
Examples:
Specify a FRAME RS for the parent container by one of following ways
(note: frame information is usually defined in parent component, but is also can be used in child component.)
- FRAMEID=my_content_frame_id
- FRAMENAME=my_content_frame_name
- FRAMEXPATH=//iframe[@id='frameId']
- FRAMEINDEX=N (1=first frame) RS by Index is not recommended.
Examples:
- If there is no frame-expression in a child RS, the last visited frame will be used to find child components; the last visited frame is normally the frame defined by the parent component.
If a frame expression is sepcified in a child RS, then that frame will be used to find this specific child ONLY. It will not affect other children.
[TopFrameWin]
TopFrameWin="FRAMEID=top_iframe"
button1="id=__item23"
button2="FRAMEID=other_iframe;\;id=__item23"
button3="id=__item25"
button1 is expected to be found in frame 'top_iframe'.
button2 is expected to be found in frame 'other_iframe'.
button3 is still expected to be found in frame 'top_iframe'.
The DOM tree looks like below
<iframe id="top_iframe">
<button id="__item23"/><-- button1 -->
<button id="__item25"/><-- button3 -->
</iframe id="top_iframe">
<iframe id="other_iframe"><-- a sibling frame -->
<button id="__item23"/><-- button2 -->
</iframe id="other_iframe">
- If there are multiple levels of frame, we must define all of them in parent/child hierarchy format separated by ";\;"
[ChildFrameWin]
ChildFrameWin="FRAMEID=top_iframe;\;FRAMEID=child_iframe"
button1="id=__item23"
button1 is expected to be found in frame 'child_iframe', which is a child of frame 'top_iframe'.
The DOM tree looks like below
<iframe id="top_iframe">
<iframe id="child_iframe"><-- a child frame -->
<button id="__item23"/>
</iframe id="child_iframe">
</iframe id="top_iframe">