continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jzurb...@apache.org
Subject svn commit: r926509 - in /continuum/trunk/continuum-webapp-test/src/test: resources/testng.properties testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Date Tue, 23 Mar 2010 09:16:43 GMT
Author: jzurbano
Date: Tue Mar 23 09:16:42 2010
New Revision: 926509

URL: http://svn.apache.org/viewvc?rev=926509&view=rev
Log:
[CONTINUUM-2490] - Getting permission denied when running selenium tests in IE
* replaced the use of waitForCondition in IE; it is causing "Permission Denied"
* added configurable properties for the number of tries and the waiting time for loading the
page


Modified:
    continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
    continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java

Modified: continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties?rev=926509&r1=926508&r2=926509&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties (original)
+++ continuum/trunk/continuum-webapp-test/src/test/resources/testng.properties Tue Mar 23
09:16:42 2010
@@ -7,6 +7,9 @@
 MAX_WAIT_TIME_IN_MS=60000
 MAX_PROJECT_WAIT_TIME_IN_MS=300000
 
+WAIT_TRIES=80
+PAGE_LOAD_TIME_IN_MS=15000
+
 ADMIN_USERNAME=admin
 ADMIN_FULLNAME=admin
 ADMIN_PASSWORD=admin123

Modified: continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java?rev=926509&r1=926508&r2=926509&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
(original)
+++ continuum/trunk/continuum-webapp-test/src/test/testng/org/apache/continuum/web/test/parent/AbstractSeleniumTest.java
Tue Mar 23 09:16:42 2010
@@ -427,11 +427,26 @@ public abstract class AbstractSeleniumTe
      * This will wait for the condition to be met.
      *   * shouldBePresent - if the locator is expected or not (true or false respectively)
      */
-    public void waitForElementPresent( String locator, boolean shoulBePresent )
+    public void waitForElementPresent( String locator, boolean shouldBePresent )
         throws Exception
     {
-        String condition = "selenium.isElementPresent(\"" + locator + "\") == " + shoulBePresent;
-        waitForCondition( condition );
+        if ( browser.equals( "*iexplore" ) )
+        {
+            int currentIt = 0;
+            int maxIt = Integer.valueOf( getProperty( "WAIT_TRIES" ) );
+            String pageLoadTimeInMs = getProperty( "PAGE_LOAD_TIME_IN_MS" );
+            
+            while ( isElementPresent( locator ) != shouldBePresent && currentIt <
maxIt )
+            {
+                getSelenium().waitForPageToLoad( pageLoadTimeInMs );
+                currentIt++;
+            }
+        }
+        else
+        {
+            String condition = "selenium.isElementPresent(\"" + locator + "\") == " + shouldBePresent;
+            waitForCondition( condition );
+        }
     }
 
     public void selectForOption( String locator, String text )



Mime
View raw message