Well, it might be a normal behavior because captureScreenshotAsString may need to read data from a video device but there is none in Xvfb mode. I haven't got a chance to read Selenium RC code yet, but here is an article on the use of java.awt.AWT package.
http://java.sun.com/developer/technicalArticles/J2SE/Desktop/headless/ The following was stated in the above article: "Many methods in the java.awt.Toolkit and java.awt.GraphicsEnvironment classes, with the exception of fonts, imaging, and printing, require the availability of a display device, keyboard, and mouse. But some classes, such as Canvas or Panel, can be executed in headless mode. Headless mode support has been available since the J2SE 1.4 platform." Tellurium does not setup any DISPLAY environment variable since it is OS-related. However, we do try to add Xvfb support at the Tellurium Core level, but that is still in progress. Please see the Xvfb class in the trunk code. Thanks, Jian On Apr 23, 5:16 am, Jonathan Share <[email protected]> wrote: > Hi, > > This is perhaps more of a question for a selenium mailing list but I > will try here first. > > After updating my build so that it can run headlessly in Xvfb > everything is running fine apart from my call to > captureScreenshotAsString(). When I call this method I get the > following exception; > > com.thoughtworks.selenium.SeleniumException: ERROR: Problem > capturing a screenshot to string: java.awt.AWTException: headless > environment > > Has anyone here experience of taking screenshots with tellurium in a > headless environment? > > Shouldn't the solution just be ensuring the correct DISPLAY > environment variable is set when starting up selenium server? > > If the answer to the last question is yes, how can I ensure tellurium > is setting this env variable correctly when starting up selenium? > > Regards, > > Jonathan > > -- > You received this message because you are subscribed to the Google Groups > "tellurium-users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group > athttp://groups.google.com/group/tellurium-users?hl=en. -- You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.
