Package com.thoughtworks.selenium

Examples of com.thoughtworks.selenium.SeleniumException


        int maxSeconds = maxTime/1000;
        logger.debug("waitForValue: locator=" + locator + " timeout=" + timeout);
        String foundValue = null;
        for(int second=0;; second++) {
            if(second >= maxSeconds) {
                throw new SeleniumException("waitForValue exceeded timeout: " + maxTime);
            }
            try{
                //getValue throws an exception if it can't find locator
                // - sleep for 1 sec and try again
                // - otherwise break as we found the value
View Full Code Here


                }
            }
            try {
                String result = super.doCommand(cmd, args);
                if (expectError) {
                    throw new SeleniumException("ERROR: Error expected");
                } else {
                    return result;
                }
            } catch (SeleniumException e) {
                if (expectError) {
View Full Code Here

        }

        String alertMessage = selenium.getAlert();

        if (!message.equals(alertMessage)) {
            throw new SeleniumException("Alert has been displayed, but the message '" + message
                    + "' doesn't equal to the expected '" + alertMessage + "'");
        }

        return true;
    }
View Full Code Here

                }
            }
            try {
                String result = super.doCommand(cmd, args);
                if (expectError) {
                    throw new SeleniumException("ERROR: Error expected");
                } else {
                    return result;
                }
            } catch (SeleniumException e) {
                if (expectError) {
View Full Code Here

        int maxSeconds = maxTime/1000;
        logger.debug("waitForValue: locator=" + locator + " timeout=" + timeout);
        String foundValue = null;
        for(int second=0;; second++) {
            if(second >= maxSeconds) {
                throw new SeleniumException("waitForValue exceeded timeout: " + maxTime);
            }
            try{
                //getValue throws an exception if it can't find locator
                // - sleep for 1 sec and try again
                // - otherwise break as we found the value
View Full Code Here

        waitFor("", condition);
    }

    public void waitFor(String narrative, Condition condition) {
        ContextImpl context = new ContextImpl();
        SeleniumException seleniumException = null;
        try {
            monitor.waitHasBegun(context, condition);
            threadSleep(initialDelay);
            while (context.elapsed() < context.timeout()) {
                seleniumException = null;
View Full Code Here

        final int[] time = new int[1];
        JUnitConditionRunner conditionRunner1 = new JUnitConditionRunner(null, 0, 100, 5000);
        try {
            conditionRunner1.waitFor(new Condition() {
                public boolean isTrue(ConditionRunner.Context runner) {
                    throw new SeleniumException("Yeehaa!");
                }
            });
            fail("the condition should have failed");
        } catch (AssertionFailedError expected) {
            assertEquals("SeleniumException while waiting for 'Condition \"null\"' (otherwise timed out); cause: Yeehaa!", expected.getMessage());
View Full Code Here

        int maxSeconds = maxTime/1000;
        logger.debug("waitForValue: locator=" + locator + " timeout=" + timeout);
        String foundValue = null;
        for(int second=0;; second++) {
            if(second >= maxSeconds) {
                throw new SeleniumException("waitForValue exceeded timeout: " + maxTime);
            }
            try{
                //getValue throws an exception if it can't find locator
                // - sleep for 1 sec and try again
                // - otherwise break as we found the value
View Full Code Here

          StringBuilder sb = new StringBuilder()
                            .append("Exception thrown while loading tck-iframe.\n")
                            .append(se.getMessage())
                            .append("\n")
                            .append(sSelenium.getBodyText());
          throw new SeleniumException(sb.toString());
        }
      }
      sSelenium.selectFrame("relative=parent");
    }
  }
View Full Code Here

        StringBuilder sb = new StringBuilder()
                            .append("Test failed but no test result details found.\n")
                           .append(se.getMessage())
                           .append("\n")
                           .append(sSelenium.getBodyText());
        throw new SeleniumException(sb.toString());
      }
    }
    else
    {
      // PPR content with no TCK span ids.
      if ((sSelenium.isElementPresent("//p[contains (.,\"FAILED\")]")))
      {
        // Portlet shows a failure result so display details
        try
        {
          details = sSelenium.getText("//p[contains(.,\"Detail\")]//p[1]");
        }
        catch (SeleniumException se)
        {
          // Portlet contains no detail section, should never happen.
          StringBuilder sb = new StringBuilder()
                            .append("Test failed but no test result details found.\n")
                            .append(se.getMessage())
                            .append("\n")
                            .append(sSelenium.getBodyText());
          throw new SeleniumException(sb.toString());
        }
      }
      else if (sSelenium.isElementPresent("//p[contains (.,\"SUCCESS\")]"))
      {
        testStatus = "SUCCESS";
View Full Code Here

TOP

Related Classes of com.thoughtworks.selenium.SeleniumException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.