Home > Programming, QA, Test and Automation Stuffs > Solution for error: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Solution for error: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

Solution for the problem with error:

ERROR com.cme.brio.selenium.ScriptException: The Script has thrown exception which is handled properly. The Selenium instance is closed and if any other script requires context of this Selenium instance will also fail. Please see the stack trace in the log and underlying exceptions to know the root cause of this problem.

ERROR Caused by: java.lang.reflect.InvocationTargetException

ERROR Caused by: groovy.lang.MissingMethodException: No signature of method: star.sa.VerifyInstrument.failResults() is applicable for argument types: (java.awt.HeadlessException) values: [java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.] Possible solutions: findResult(groovy.lang.Closure)

ERROR An error occured while executing the script. Reason: Exception thrown. Please see logs for the complete stack trace.

 

When you get his error, just put above the code with Toolkit this line:

System.setProperty(“java.awt.headless”, “false”);
                        System.out.println(java.awt.GraphicsEnvironment.isHeadless());

Just this will enable the keys in whatever pc.

Bye bye 🙂

Advertisements
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: