Re: Frames work around not pretty but it works up to 7 frames deep

5 views
Skip to first unread message

laminac

unread,
Jun 12, 2006, 12:32:03 PM6/12/06
to selenium-users...@googlegroups.com
to install it just replace the code in the selenium-server.jar file. the directory for the new version is core/scripts/selenium-browserbot.js file. We did find that it wont get confirmations correctly so we had to modify a little more code to get confirmations to work properly. just add this code to the same file, it doesn't mater where in the file

BrowserBot.prototype.processFrames = function(f)
{
var testWindow = eval('this.getCurrentWindow()'+f);
this.processRestOfFrames(testWindow);
};

BrowserBot.prototype.processRestOfFrames = function(testWindow)
{
//var testWindow = this.getCurrentWindow();
this.modifyWindowToRecordPopUpDialogs(testWindow, this);
this.modifySeparateTestWindowToDetectPageLoads(testWindow);
//this.currentPage = PageBot.createForWindow(testWindow);
var f = testWindow.frames;
var l = f.length;
for(var i =0;i<l;i++)
{
this.processFrames(f+);
}
};


then before calling the confirm option you must call (in java)
selenium.getEval("selenium.browserbot.processFrames('"+frame+"');");

where frame is the location of the frame where the popup is or you can reference a parent frame since this will check all children frames. the frame variable MUST START WITH A PERIOD e.g, ".parentFrame.childFrame.anotherFrame", you can use an empty string to this function and it will start from the main frame.

Patrick Lightbody

unread,
Jun 12, 2006, 11:02:56 PM6/12/06
to selenium-users...@googlegroups.com
Tracy,
We're working on this stuff (Nelson, Dan, and I are working together on a daily basis on this).

Did you ever get a chance to check out HostedQA? :)

Patrick

Adrian Roman

unread,
Jun 13, 2006, 5:28:22 AM6/13/06
to selenium-users...@googlegroups.com
Hi Patrick,

You say you guys are working on this stuff - will you also include fixes for Selenium accessors when you do the multi-frames fix?

Because at the moment, I am able to open my app in a pop-up window and click around in it, but I don't seem to have any luck with using simple accessors, like "isTextPresent" - it just says the text is not found. My assumption is that the accessor checks for the top page only, and is not looking in the lower frames for the specified text.

Thanks,
Adrian

Tracy

unread,
Jun 15, 2006, 5:41:07 AM6/15/06
to selenium-users...@googlegroups.com
We pretty quickly decided we wanted to do it "in-house", the we searched for tools and Selenium came out on top by far.

We may be interested in consulting/advisory work to help us in our setup if you are available for that.

jonatan

unread,
Jun 16, 2006, 7:43:55 AM6/16/06
to selenium-users...@googlegroups.com
Hi,

I have some problems with the frames support fix. I being submitted a form, when the page loads I'm trying to click a link on a frame and it crashes. I'd got some different exceptions:

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Selenium failure. Please report to seleni...@openqa.org, with error details from the log window.
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:73)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:82)

OR

Exception in thread "main" com.thoughtworks.selenium.SeleniumException: ERROR: Selenium failure. Please report to seleni...@openqa.org, with error details from the log window.* loc property is undefined*
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:73)
at com.thoughtworks.selenium.DefaultSelenium.click(DefaultSelenium.java:82)

Now, i can't reproduce the last exception, always i get the first.
I was debugged the javascript code added for the fix and i have seen that it crashes when it tries to execute line 603. I don't know the reason, because on inDocument object exists the element named identifier value that it wanted.
*/**
600 * Find the element with id - can't rely on getElementById, coz it returns by name as well in IE..
601 */
602PageBot.prototype.locateElementById = function(identifier, inDocument) {
603 var element = inDocument.getElementById(identifier);
604 if (element && element.id === identifier) {
605 return element;

any ideas?

Reply all
Reply to author
Forward
0 new messages