Topic:
Accessing parent.selenium.browserbot
Body:
I’m trying to access selenium from my client side script so that I can call modifyWindowToRecordPopUpDialogs() and work around the issue with alerts fired by window.onload. When I access the page via Twist parent.selenium comes back undefined. I am able to see parent.selenium via a DOM explorer though. Here’s the code I’m trying to execute: if (parent.selenium) { parent.selenium.browserbot.modifyWindowToRecordPopUpDialogs(window, parent.selenium.browserbot);} Any ideas? Thanks
Comment
I am hoping that you are trying to send alerts fired by window.onload of pop-ups to base(opener) window in IE. If this is the case, to refer selenium object of base window (opener), you should use opener.selenium instead of parent.selenium. In order to send “alerts” to opener window, you may have client side script as below
... if (opener.selenium) { window.alert = function(alert) { window.opener.selenium.browserbot.recordedAlerts.push(alert); } } ...and twist driver code would look like
Actually the sample code I pasted in was incorrect I was trying to use window.selenium.browserbot not parent.
I ended up finding a solution to the getAlert() issue by modifying the appropriate code to be included in a window.setTimeout().