Saturday, September 06, 2014

Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

If you get this error, do not worry:
Downloading: https://s3.amazonaws.com/Minecraft.Download/launcher/launcher.pack.lzma Exception: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
This just means that your ssl certs are not correct for the java version you have installed. In my case I was also getting the following error:
$ ls -l /etc/ssl/certs/java/cacerts ls: cannot access /etc/ssl/certs/java/cacerts: No such file or directory
So, this command fixed my issue:
scp -pr root@a_different_box_with_working_certs:/etc/ssl/certs/java/cacerts /etc/ssl/certs/java/.
Hope that helps you too.

This was found using the following version of java:
$ java -version
openjdk version "1.8.0_20" OpenJDK Runtime Environment (build 1.8.0_20-b23) OpenJDK 64-Bit Server VM (build 25.20-b22, mixed mode)

Friday, January 31, 2014

Element is not currently visible and so may not be interacted with

This page was somewhat helpful, but did not mention the "transform" style needing to be checked. Then I found this fellow using C# who mentioned the transform value. When I put the two together I came up with this solution:
((JavascriptExecutor)driver).executeScript(
   "arguments[0].style.transform = 'none';",
   myFavoriteElement
);
After setting transform = 'none', myFavoriteElement.sendKeys() did not fail with the infamous error:
Element is not currently visible and so may not be interacted with(..)
So I guess we should add transform != 'none' to the list as follows:
  • visibility != hidden
  • display != none (is also checked against every parent element)
  • opacity != 0 (in rc2 this is no longer checked for clicking an element)
  • height and width are both > 0
  • for an input, the attribute type != hidden
  • transform != 'none'
This issue was found using selenium.version = 2.35.0

NOTE: myFavoriteElement was an input type=file generated by the PrimeFaces fileUpload tag. PrimeFaces 4.0 looks like it introduced the transform. Also, when I checked to see what the transform value was before setting it to none, it logged: myFavoriteElement.getCssValue("transform") = matrix(4, 0, 0, 4, -300, 0).

Hope that helps.