logo       

letting Selenium do what it wants (was: user.js for firefox): msg#00069

web.selenium.user

Subject: letting Selenium do what it wants (was: user.js for firefox)

On Tue, Oct 18, 2005 at 04:44:30AM -0700, vernon viles wrote:
> OK, not even the files technique is working. I must be
> doing something wrong. If Paul is out there, did the
> file technique work for you?

Yes.

What I imagine you're missing is the actual assertion of the
capabilities you granted.

For any javascript code to actually use any of those capabilities, the
function it's in or a calling function needs to have called:

netscape.security.PrivilegeManager.enablePrivilege(capstr);

where capstr is a string containing a space-separated list of the
capabilities you need your code to have (like "UniversalBrowserRead
UniversalFileRead ...").

Our solution was to hook into the kickoffNextCommandExecution method in
the TestLoop like so:

testLoop.reallyKickoffNextCommandExecution =
testLoop.kickoffNextCommandExecution;
testLoop.kickoffNextCommandExecution = function () {
netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead
UniversalFileRead UniversalBrowserWrite UniversalBrowserAccess");
return testLoop.reallyKickoffNextCommandExecution();
}

(that is done in our SeleneseRunner.html equivalent, right before
testLoop.start().)

Normally that enablePrivilege call would make a dialog pop up asking the
user if that script should be allowed to have those capabilities, but
the "granted" line in our user.js tells Mozilla [Firefox] to always
grant those permissions without asking.

--
paul


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise