Java and/or Oracle objects are not recognise and a security exception is shown in the Java console

When trying to record against Java objects or Oracle objects, the objects are not seen as such and the Java console displays some exception related to the security, like for example:

Exception caught =access denied (java.util.PropertyPermission user.name read)

java.security.AccessControlException: access denied (java.util.PropertyPermission user.name read)

at java.security.AccessControlContext.checkPermission(Unknown Source)

at java.security.AccessController.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPermission(Unknown Source)

at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)

The application under test does not have the required permissions to be automated.

It is necessary to modify the permissions in the "java.policy" file. To do so:

Note: refer "testing product" as QuickTest Professional (QTP), Unified Functional Testing (UFT) or Sprinter

1.Close testing product.

2.If application is Java Applet based (either Java or Oracle applications), close all opened browsers

3.Search / Locate "java.policy" file in the JRE directory (by default the path should be: "C:\Program Files\Java\jre6\lib\security")

4.Open mentioned file with any text editor

5.Add the following lines at the end of the file:

grant {

permission java.security.AllPermission;

};

6.Save the file

7.Try again

8.If same error occurs, then

1.Repeat steps 1 – 2

2.Search all "java.policy" on machine

3.Repeat steps 4 to 7 with each found file

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s