continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From car...@apache.org
Subject svn commit: r795298 - /continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
Date Sat, 18 Jul 2009 02:25:37 GMT
Author: carlos
Date: Sat Jul 18 02:25:37 2009
New Revision: 795298

URL: http://svn.apache.org/viewvc?rev=795298&view=rev
Log:
Check the case when the test failed before the session was started

Modified:
    continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java

Modified: continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java?rev=795298&r1=795297&r2=795298&view=diff
==============================================================================
--- continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
(original)
+++ continuum/branches/continuum-selenium-parallel-carlos/src/test/testng/org/apache/continuum/web/test/listener/CaptureScreenShotsListener.java
Sat Jul 18 02:25:37 2009
@@ -102,8 +102,16 @@
      */
     private void captureScreenshot( String baseFileName )
     {
-        getSession().getSelenium().windowMaximize();
-        getSession().getSelenium().captureEntirePageScreenshot( baseFileName + ".png", ""
);
+        if ( getSession().isStarted() )
+        {
+            getSession().getSelenium().windowMaximize();
+            getSession().getSelenium().captureEntirePageScreenshot( baseFileName + ".png",
"" );
+        }
+        else
+        {
+            /* the test failed before the session was started */
+            logger.warn( "Unable to take screenshot, seelenium session is not started" );
+        }
     }
 
     private void captureHtmlSource( String baseFileName )



Mime
View raw message