4

I'm having problems verifying elements in a page made up of framesets and frames.

I'm using the code:

    selenium.selectFrame("relative=up");
    selenium.selectFrame("topFrame");

But it fails with the error "Element topFrame not found". I get similar errors when trying to navigate to any frames.

I've also tried specifying the DOM path, and using indexes, but nothing seems to work.

The HTML looks like this:

<frameset framespacing="0" border="0" frameborder="NO" rows="80,*">
    <frame scrolling="NO" frameborder="NO" src="header.html" noresize="" name="topFrame">
    <frameset framespacing="0" border="0" frameborder="NO" cols="210,*">
        <frame scrolling="NO" frameborder="NO" src="menu.html" name="leftFrame">
        <frame scrolling="YES" bordercolor="#78B0D5" frameborder="YES" src="content.html"     name="mainFrame">
        </frame>
    </frameset>
</frameset>

Any suggestions?

3 Answers 3

1

in the above mentioned command instead of writing name="topFrame" try using id="topFrame". selenium uses the id to identify the object.

Sign up to request clarification or add additional context in comments.

Comments

1

In my experience, selenium is 'temperamental' when it comes to setting frame contexts. I find it useful to define explicit frame identifiers rather than just rely on context. So in your case, I would use:

selenium.selectFrame("relative=top");
selenium.selectFrame("css=frame[class=...]");

Comments

0

When using relative frame navigation, it obviously all depends upon where you start from. To be absolutely sure of that, we always start our frame navigation with selenium.selectFrame("relative=top");, which positions you at the outer <FRAMESET> level, where selenium.selectFrame("topFrame"); would make sense.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.