continuum-commits mailing list archives

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

URL: http://svn.apache.org/viewvc?rev=795303&view=rev
Log:
Prevent errors when session was not 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=795303&r1=795302&r2=795303&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 03:15:01 2009
@@ -49,6 +49,13 @@
 
     private void captureError( ITestResult tr )
     {
+        if ( !getSession().isStarted() )
+        {
+            /* the test failed before the session was started */
+            logger.warn( "Unable to take screenshot, selenium session is not started" );
+            return;
+        }
+
         String baseFileName = getBaseFileName( tr );
         try
         {
@@ -102,16 +109,8 @@
      */
     private void captureScreenshot( String baseFileName )
     {
-        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" );
-        }
+        getSession().getSelenium().windowMaximize();
+        getSession().getSelenium().captureEntirePageScreenshot( baseFileName + ".png", ""
);
     }
 
     private void captureHtmlSource( String baseFileName )



Mime
View raw message