diff --git a/scripts/testing/ensure_selenium_rc_server_has_started.sh b/scripts/testing/ensure_selenium_rc_server_has_started.sh deleted file mode 100755 index b9cd22270a..0000000000 --- a/scripts/testing/ensure_selenium_rc_server_has_started.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash - -# Parameters: -# $1: rc_server_log_path -# $2: xvfb_log_path (optional) -# $3: xvfb_display (optional) - - -SCRIPT_FILE_DIR="`dirname $0`" -TESTING_SCRIPTS_DIR="`cd $SCRIPT_FILE_DIR; pwd`" - -function display_usage_and_exit -{ - echo "Usage: ensure_selenium_rc_server_has_started [xvfb_log_path] [xvfb_display]" - echo "Optionally specify an xvfb_log_path to start the Selenium RC server in headless mode" - echo "Additionally specify an xvfb_display to start in headless mode on a specific display" - exit -1 -} - -function verify_script_parameters -{ - # warn if extraneous parameters exist - if [ -n "$4" ]; then - echo ">> Unexpected number of parameters: $*" - display_usage_and_exit - fi - - # check if rc_server_log_path parameter exists - if [ -z "$1" ]; then - echo ">> Missing rc_server_log_path parameter" - display_usage_and_exit - fi -} - -function ensure_xvfb_is_running_and_set_display -{ - # Parameters: - # $1: xvfb_log_path - # $2: xvfb_display - - XVFB_LOG_PATH="$1" - - # start Xvfb if the Xvfb process files does not exist - if [ ! -e "$XVFB_LOG_PATH/xvfb.pid" ]; then - XVFB_DISPLAY=":$$" # use the current process ID to avoid clashes if Xvfb is being used elsewhere - - # otherwise use the specified display value - if [ -n "$2" ]; then - XVFB_DISPLAY="$2" - fi - - "$TESTING_SCRIPTS_DIR/start_xvfb.sh" $XVFB_LOG_PATH $XVFB_DISPLAY - fi - - export DISPLAY="`cat $XVFB_LOG_PATH/xvfb_display.txt`" -} - -function ensure_selenium_rc_server_is_running -{ - # Parameters: - # $1: rc_server_log_path - # $2: xvfb_log_path - # $3: xvfb_display - - RC_SERVER_LOG_PATH="$1" - - # check if the Selenium RC server is already running - if [ ! -e "$RC_SERVER_LOG_PATH/rc_server.pid" ]; then - # check if the xvfb_log_path parameter was also provided - if [ -n "$2" ]; then - XVFB_LOG_PATH="$2" - ensure_xvfb_is_running_and_set_display "$XVFB_LOG_PATH" "$3" - - "$TESTING_SCRIPTS_DIR/start_selenium_rc_server.sh" "$RC_SERVER_LOG_PATH" "$XVFB_LOG_PATH" - else - "$TESTING_SCRIPTS_DIR/start_selenium_rc_server.sh" "$RC_SERVER_LOG_PATH" - fi - fi -} - -verify_script_parameters $* -ensure_selenium_rc_server_is_running "$1" "$2" "$3" diff --git a/scripts/testing/run_acceptance_tests.sh b/scripts/testing/run_acceptance_tests.sh deleted file mode 100755 index b6d0c8cc44..0000000000 --- a/scripts/testing/run_acceptance_tests.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/bash - -# Parameters: -# $1: acceptance_test_project_name -# $2: rc_server_log_path -# $3: xvfb_log_path (optional) - - -function display_usage_and_exit -{ - echo "Usage: run_acceptance_tests [xvfb_log_path]" - echo "Optionally specify an xvfb_log_path to run tests in headless mode" - exit -1 -} - -function verify_script_parameters -{ - # warn if extraneous parameters exist - if [ -n "$4" ]; then - echo ">> Unexpected number of parameters: $*" - display_usage_and_exit - fi - - # check if acceptance_test_project_name parameter exists - # tests are expected in the tests/PROJECT_NAME/acceptance directory - if [ -z "$1" ]; then - echo ">> Missing acceptance_test_project_name parameter (e.g. akvo)" - display_usage_and_exit - fi - - # check if rc_server_log_path parameter exists - if [ -z "$2" ]; then - echo ">> Missing rc_server_log_path parameter" - display_usage_and_exit - fi -} - -function set_python_path_for_acceptance_tests -{ - # check if PYTHONPATH exists - if [ -z "$PYTHONPATH" ]; then - export PYTHONPATH="$ACCEPTANCE_TEST_ROOT_DIR" - else - export PYTHONPATH="$ACCEPTANCE_TEST_ROOT_DIR:$PYTHONPATH" - fi -} - - -verify_script_parameters $* - -SCRIPT_FILE_DIR="`dirname $0`" -TESTING_SCRIPTS_DIR="`cd $SCRIPT_FILE_DIR; pwd`" -PROJECT_NAME="$1" -ACCEPTANCE_TEST_ROOT_DIR="`cd $TESTING_SCRIPTS_DIR/../../tests/$PROJECT_NAME/acceptance; pwd`" - -RC_SERVER_LOG_PATH="$2" -XVFB_LOG_PATH="" - -RC_SERVER_WAS_STARTED_BY_THIS_SCRIPT="Y" -XVFB_WAS_STARTED_BY_THIS_SCRIPT="Y" - -if [ -e "$RC_SERVER_LOG_PATH/rc_server.pid" ]; then - RC_SERVER_WAS_STARTED_BY_THIS_SCRIPT="N" -fi - -if [ -n "$3" ]; then - XVFB_LOG_PATH="$3" - - if [ -e "$XVFB_LOG_PATH/xvfb.pid" ]; then - XVFB_WAS_STARTED_BY_THIS_SCRIPT="N" - fi -fi - -"$TESTING_SCRIPTS_DIR/ensure_selenium_rc_server_has_started.sh" "$RC_SERVER_LOG_PATH" "$XVFB_LOG_PATH" - -# proceed if no error codes returned from last script -if [ $? -eq 0 ]; then - set_python_path_for_acceptance_tests - - # use the Xvfb display if available - if [ -n "$XVFB_LOG_PATH" -a -e "$XVFB_LOG_PATH/xvfb_display.txt" ]; then - XVFB_DISPLAY="`cat $XVFB_LOG_PATH/xvfb_display.txt`" - - export DISPLAY=$XVFB_DISPLAY - - if [ "$RC_SERVER_WAS_STARTED_BY_THIS_SCRIPT" = "N" ]; then - echo "Xvfb running on display $XVFB_DISPLAY" - echo "Xvfb log path: $XVFB_LOG_PATH" - echo "Selenium RC server log path: $RC_SERVER_LOG_PATH" - fi - - echo "DISPLAY environment variable is $DISPLAY" - printf "Running tests in headless mode on display $DISPLAY\n\n" - fi - - "$ACCEPTANCE_TEST_ROOT_DIR/all_test_suites.py" - - if [ "$RC_SERVER_WAS_STARTED_BY_THIS_SCRIPT" = "Y" ]; then - "$TESTING_SCRIPTS_DIR/stop_selenium_rc_server.py" "$RC_SERVER_LOG_PATH" - - if [ -n "$XVFB_LOG_PATH" -a "$XVFB_WAS_STARTED_BY_THIS_SCRIPT" = "Y" ]; then - "$TESTING_SCRIPTS_DIR/stop_xvfb.py" "$XVFB_LOG_PATH" - fi - fi -else - printf "\nUnable to start Selenium RC server or Xvfb due to errors above\n" -fi diff --git a/scripts/testing/run_deployment_unit_tests.py b/scripts/testing/run_deployment_unit_tests.py deleted file mode 100755 index 1e7e74c286..0000000000 --- a/scripts/testing/run_deployment_unit_tests.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - - -import os, shutil, subprocess, sys - - -DEPLOYMENT_SCRIPTS_HOME = os.path.realpath(os.path.join(os.path.dirname(__file__), '../deployment')) - - -class TestExecutionMode(object): - - CI = 'ci' - NORMAL = 'normal' - - allowed_modes = [CI, NORMAL] - - -class DeploymentTestsRunner(object): - - def __init__(self, execution_mode, virtualenv_path): - self.execution_mode = execution_mode - self.virtualenv_path = virtualenv_path - - def run_unit_tests(self): - print '>> Using virtualenv at: %s\n' % self.virtualenv_path - self._ensure_config_file_exists('custom.py') - self._run_within_virtualenv(self._run_all_test_suites_command()) - - def _ensure_config_file_exists(self, config_file_name): - if not os.path.exists(self._credentials_path_for(config_file_name)): - if self.execution_mode == TestExecutionMode.CI: - ci_user_config_path = self._credentials_path_for(config_file_name.replace('.', '_ci.')) - shutil.copy2(ci_user_config_path, self._credentials_path_for(config_file_name)) - else: - self._exit_with_missing_config_message(config_file_name) - - def _exit_with_missing_config_message(self, config_file_name): - usage_message = 'Missing credentials configuration file' + \ - '\n## Copy the %s file and edit as necessary' % self._credentials_path_for('%s.template' % config_file_name) - self._exit_with(os.EX_USAGE, usage_message) - - def _credentials_path_for(self, credentials_file_name): - return os.path.join(DEPLOYMENT_SCRIPTS_HOME, 'fab/config/rsr/credentials', credentials_file_name) - - def _run_all_test_suites_command(self): - return ' '.join([os.path.join(DEPLOYMENT_SCRIPTS_HOME, 'fab/tests/all_test_suites.py'), self.execution_mode]) - - def _run_within_virtualenv(self, command): - exit_code = subprocess.call('source %s/bin/activate && %s' % (self.virtualenv_path, command), shell=True, executable='/bin/bash') - - if exit_code != 0: - self._exit_with(exit_code, 'Deployment unit tests failed as above') - - def _exit_with(self, error_code, error_message): - print '## %s\n' % error_message - raise SystemExit(error_code) - - -def display_usage_and_exit(error_message): - print error_message - print 'Usage: run_deployment_unit_tests [execution_mode]\n' + \ - ' where execution_mode is either \'normal\' (default) or \'ci\'\n' - sys.exit(os.EX_USAGE) - -def verify_execution_parameters(): - if len(sys.argv) < 2: - display_usage_and_exit('## Missing parameters') - elif len(sys.argv) > 3: - display_usage_and_exit('## Too many parameters: %s' % ' '.join(sys.argv[1:])) - - virtualenv_path = sys.argv[1] - - if not os.path.exists(virtualenv_path): - display_usage_and_exit('## Invalid virtualenv path: %s' % virtualenv_path) - - if len(sys.argv) == 3: - execution_mode = sys.argv[2] - - if execution_mode not in TestExecutionMode.allowed_modes: - display_usage_and_exit('## Unrecognised test execution mode: %s' % execution_mode) - - -if __name__ == '__main__': - verify_execution_parameters() - - virtualenv_path = sys.argv[1] - execution_mode = TestExecutionMode.NORMAL - - if len(sys.argv) == 3: - execution_mode = sys.argv[2] - - DeploymentTestsRunner(execution_mode, virtualenv_path).run_unit_tests() diff --git a/scripts/testing/run_django_tests.sh b/scripts/testing/run_django_tests.sh deleted file mode 100755 index e85341ef1b..0000000000 --- a/scripts/testing/run_django_tests.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/bash - -cd "`dirname $0`" - -# check whether virtualenv_path parameter exists -if [ -z "$1" ]; then - echo "Usage: run_django_tests [ci_mode]" - exit -1 -fi - -VIRTUALENV_PATH=$1 - -# check whether virtualenv path exists -if [ -r $VIRTUALENV_PATH ]; then - source $VIRTUALENV_PATH/bin/activate -else - printf ">> Akvo virtual environment [%s] not found\n" $VIRTUALENV_PATH - exit -1 -fi - -cd ../../akvo - -printf "\n>> Validating Django models:\n" -python manage.py validate - -printf "\n>> Syncing database:\n" -echo no | python manage.py syncdb -python manage.py syncdb - -printf "\n>> Running Django tests:\n" -python manage.py test --noinput rsr - -deactivate diff --git a/scripts/testing/start_selenium_rc_server.sh b/scripts/testing/start_selenium_rc_server.sh deleted file mode 100755 index c494cc8463..0000000000 --- a/scripts/testing/start_selenium_rc_server.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/bin/bash - -# Parameters: -# $1: logging_path -# $2: xvfb_logging_path (optional) - - -function display_usage_and_exit -{ - echo "Usage: start_selenium_rc_server [xvfb_logging_path]" - echo "Optionally specify an xvfb_logging_path to operate in headless mode" - exit -1 -} - -function verify_script_parameters -{ - # warn if extraneous parameters exist - if [ -n "$3" ]; then - echo ">> Unexpected number of parameters: $*" - display_usage_and_exit - fi - - # check whether the logging_path parameter exists - if [ -z "$1" ]; then - echo ">> Missing logging_path parameter" - display_usage_and_exit - fi - - # check whether the logging path exists and is writable - if [ ! -e "$1" ]; then - echo ">> Selenium RC server logging path does not exist: $1" - exit -1 - elif [ ! -w "$1" ]; then - echo ">> Selenium RC server logging path is not writable: $1" - exit -1 - fi -} - - -verify_script_parameters $* - -function display_xvfb_startup_usage_and_exit -{ - echo "Use the start_xvfb script to start Xvfb separately" - echo "Use the ensure_selenium_rc_server_has_started script to start Selenium RC and Xvfb as necessary" - exit -1 -} - -function exit_if_xvfb_is_not_running -{ - # Parameters: - # $1: xvfb_log_path - - XVFB_LOG_PATH="$1" - - # check for Xvfb process files - if [ ! -e "$XVFB_LOG_PATH/xvfb.pid" ]; then - echo ">> Xvfb does not appear to be running: missing $XVFB_LOG_PATH/xvfb.pid file" - display_xvfb_startup_usage_and_exit - elif [ ! -e "$XVFB_LOG_PATH/xvfb_display.txt" ]; then - echo ">> Xvfb does not appear to be running: missing $XVFB_LOG_PATH/xvfb_display.txt file" - display_xvfb_startup_usage_and_exit - fi -} - -# check if we're running the Selenium server in headless mode -if [ -n "$2" ]; then - XVFB_LOG_PATH="$2" - exit_if_xvfb_is_not_running "$XVFB_LOG_PATH" - - export DISPLAY="`cat $XVFB_LOG_PATH/xvfb_display.txt`" - echo "Starting Selenium RC server on display $DISPLAY" -fi - -UTC_LOG_TIMESTAMP=`date -u +%Y%m%d_%H%M%S` -RC_SERVER_LOG_PATH=$1 -RC_SERVER_LOG_FILE=$RC_SERVER_LOG_PATH/rc_server_$UTC_LOG_TIMESTAMP.log - -SCRIPT_FILE_DIR="`dirname $0`" -RC_SERVER_PATH="`cd $SCRIPT_FILE_DIR/tools/selenium/1.0.3/rc-server; pwd`" - -echo "Selenium RC server log: $RC_SERVER_LOG_FILE" - -java -version > $RC_SERVER_LOG_FILE 2>&1 -java -jar $RC_SERVER_PATH/selenium-server.jar >> $RC_SERVER_LOG_FILE 2>&1 & -echo $! > $RC_SERVER_LOG_PATH/rc_server.pid # save RC server process ID for later use - -function wait_for_selenium_rc_server_to_complete_startup -{ - echo "Waiting for Selenium RC server to finish starting..." - - MAX_WAIT_ATTEMPTS=60 - ATTEMPT=0 - SECONDS_TO_SLEEP=2 - - while [ -z "`grep jetty.servlet $RC_SERVER_LOG_FILE`" -a $ATTEMPT -lt $MAX_WAIT_ATTEMPTS ]; do - let ATTEMPT++ - sleep $SECONDS_TO_SLEEP - done - - if [ -n "`grep jetty.servlet $RC_SERVER_LOG_FILE`" ]; then - printf "Selenium RC server startup completed\n\n" - else - echo ">> Selenium RC server failed to complete startup after waiting for 120 seconds" - exit -1 - fi -} - -wait_for_selenium_rc_server_to_complete_startup diff --git a/scripts/testing/start_xvfb.sh b/scripts/testing/start_xvfb.sh deleted file mode 100755 index f2fdd51ab1..0000000000 --- a/scripts/testing/start_xvfb.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/bash - -# Parameters: -# $1: log_path -# $2: xvfb_display - -function display_usage_and_exit -{ - echo "Usage: start_xvfb " - exit -1 -} - -function ensure_parameter_exists -{ - # Parameters: - # $1: parameter value - # $2: parameter name - - if [ -z "$1" ]; then - echo ">> Missing $2 parameter" - display_usage_and_exit - fi -} - -function verify_script_parameters -{ - # warn if extraneous parameters exist - if [ -n "$3" ]; then - echo ">> Unexpected number of parameters: $*" - display_usage_and_exit - fi - - ensure_parameter_exists "$1" "log_path" - ensure_parameter_exists "$2" "xvfb_display" - - # check whether the logging path exists and is writable - if [ ! -e "$1" ]; then - echo ">> Xvfb logging path does not exist: $1" - exit -1 - elif [ ! -w "$1" ]; then - echo ">> Xvfb logging path is not writable: $1" - exit -1 - fi -} - - -verify_script_parameters $* - -XVFB_PATH=`which Xvfb` -XVFB_LOG_PATH="$1" -XVFB_DISPLAY=$2 - -# check whether Xvfb is on the path and executable -if [ ! -x "$XVFB_PATH" ]; then - echo ">> Xvfb not found on the path or not executable: $PATH" - exit -1 -fi - -# check if Xvfb is already running -if [ -e "$XVFB_LOG_PATH/xvfb.pid" -a -e "$XVFB_LOG_PATH/xvfb_display.txt" ]; then - XVFB_PID="`cat $XVFB_LOG_PATH/xvfb.pid`" - XVFB_DISPLAY="`cat $XVFB_LOG_PATH/xvfb_display.txt`" - - echo ">> Xvfb already appears to be running with process ID $XVFB_PID on display $XVFB_DISPLAY" - echo "From details in $XVFB_LOG_PATH/xvfb.pid and $XVFB_LOG_PATH/xvfb_display.txt" - exit -1 -fi - -UTC_LOG_TIMESTAMP=`date -u +%Y%m%d_%H%M%S` -XVFB_LOG_FILE=$XVFB_LOG_PATH/xvfb_$UTC_LOG_TIMESTAMP.log - -echo "Starting Xvfb on display $XVFB_DISPLAY" -printf "Xvfb log: $XVFB_LOG_FILE\n\n" -$XVFB_PATH $XVFB_DISPLAY -ac > $XVFB_LOG_FILE 2>&1 & -echo $! > $XVFB_LOG_PATH/xvfb.pid # save Xvfb process ID -echo $XVFB_DISPLAY > $XVFB_LOG_PATH/xvfb_display.txt # save Xvfb display diff --git a/scripts/testing/stop_selenium_rc_server.py b/scripts/testing/stop_selenium_rc_server.py deleted file mode 100755 index 6ef11ff53e..0000000000 --- a/scripts/testing/stop_selenium_rc_server.py +++ /dev/null @@ -1,113 +0,0 @@ -#!/usr/bin/env python - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -import os, signal, sys - -from selenium import selenium - -DEFAULT_SELENIUM_RC_HOST = "localhost" -DEFAULT_SELENIUM_RC_PORT = 4444 -DEFAULT_BROWSER_ENVIRONMENT = "*firefox" - -RC_SERVER_PID_FILE_NAME = "rc_server.pid" - - -def display_usage_and_exit(): - default_values = "%s %i %s" % (DEFAULT_SELENIUM_RC_HOST, DEFAULT_SELENIUM_RC_PORT, DEFAULT_BROWSER_ENVIRONMENT) - print 'Usage: stop_selenium_rc_server [rc_host] [rc_port] [browser_environment]' - print "If no server parameters are specified, the following default values will be used: %s" % (default_values) - sys.exit(1) - -def verify_script_parameters(): - if len(sys.argv) <= 1: - print ">> Missing rc_server_log_path parameter" - display_usage_and_exit() - elif len(sys.argv) != 2 and len(sys.argv) != 5: - print ">> Unexpected number of parameters: %s" % (sys.argv[1:]) - display_usage_and_exit() - elif len(sys.argv) == 5 and not sys.argv[3].isdigit(): - print ">> The rc_port parameter [%s] must be an integer" % sys.argv[3] - display_usage_and_exit() - - rc_server_log_path = os.path.realpath(sys.argv[1]) - - if not os.path.exists(rc_server_log_path): - print ">> Selenium RC server log path does not exist: %s" % (rc_server_log_path) - display_usage_and_exit() - elif not os.path.isdir(rc_server_log_path): - print ">> Selenium RC server log path is not a directory: %s" % (rc_server_log_path) - display_usage_and_exit() - -def stop_rc_server(): - if rc_server_process_is_not_running(): - print "Selenium RC server does not appear to be running -- process ID file not found at: %s" % rc_server_process_id_file_path() - sys.exit(0) - - try: - stop_rc_server_with_shutdown_command() - except Exception, exception: - print "Unable to stop Selenium RC server with shutdown command: %s" % (exception) - terminate_unresponsive_rc_server_process() - - os.remove(rc_server_process_id_file_path()) - -def rc_server_process_is_not_running(): - return not os.path.exists(rc_server_process_id_file_path()) - -def stop_rc_server_with_shutdown_command(): - selenium_rc_host = DEFAULT_SELENIUM_RC_HOST - selenium_rc_port = DEFAULT_SELENIUM_RC_PORT - browser_environment = DEFAULT_BROWSER_ENVIRONMENT - - if len(sys.argv) == 5: - selenium_rc_host = sys.argv[2] - selenium_rc_port = int(sys.argv[3]) - browser_environment = sys.argv[4] - - try: - print "\nStopping Selenium RC server [%s, %i, %s]..." % (selenium_rc_host, selenium_rc_port, browser_environment) - selenium(selenium_rc_host, selenium_rc_port, browser_environment, '').shut_down_selenium_server() - print "Server stopped successfully\n" - except Exception, exception: - if str(exception).endswith('Connection refused'): - print "Server already appears to have been stopped: %s" % (exception) - else: - raise exception - -def terminate_unresponsive_rc_server_process(): - process_id = rc_server_process_id() - - if process_id_exists(process_id): - print "Terminating unresponsive Selenium RC server process ID %i" % (process_id) - os.kill(process_id, signal.SIGTERM) # send terminate signal - -def rc_server_process_id(): - process_id_file_path = rc_server_process_id_file_path() - process_id = open(process_id_file_path, 'r').readline().strip() - - if not process_id.isdigit(): - raise Exception("Unexpected Selenium RC server process ID [%s] in: %s" % (process_id, process_id_file_path)) - - return int(process_id) - -def process_id_exists(process_id): - try: - os.kill(process_id, 0) # attempt to send a harmless signal (0) to the process - return True - except OSError, os_error: - if str(os_error).endswith('No such process'): - print "Process ID %i no longer exists" % (process_id) - return False - else: - raise os_error - -def rc_server_process_id_file_path(): - return os.path.join(os.path.realpath(sys.argv[1]), RC_SERVER_PID_FILE_NAME) - - -if __name__ == "__main__": - verify_script_parameters() - stop_rc_server() diff --git a/scripts/testing/stop_xvfb.py b/scripts/testing/stop_xvfb.py deleted file mode 100755 index 52d055e638..0000000000 --- a/scripts/testing/stop_xvfb.py +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/env python - -# Akvo RSR is covered by the GNU Affero General Public License. -# See more details in the license.txt file located at the root folder of the Akvo RSR module. -# For additional details on the GNU license please see < http://www.gnu.org/licenses/agpl.html >. - -import os, signal, sys - - -XVFB_PID_FILE_NAME = "xvfb.pid" -XVFB_DISPLAY_NUMBER_FILE_NAME = "xvfb_display.txt" - - -def display_usage_and_exit(): - print 'Usage: stop_xvfb ' - sys.exit(1) - -def verify_script_parameters(): - if len(sys.argv) <= 1: - print ">> Missing xvfb_log_path parameter" - display_usage_and_exit() - elif len(sys.argv) != 2: - print ">> Unexpected number of parameters: %s" % (sys.argv[1:]) - display_usage_and_exit() - - xvfb_log_path = os.path.realpath(sys.argv[1]) - - if not os.path.exists(xvfb_log_path): - print ">> Xvfb log path does not exist: %s" % (xvfb_log_path) - display_usage_and_exit() - elif not os.path.isdir(xvfb_log_path): - print ">> Xvfb log path is not a directory: %s" % (xvfb_log_path) - display_usage_and_exit() - -def stop_xvfb_process(): - if xvfb_process_is_not_running(): - print "Xvfb process does not appear to be running -- process ID file not found at: %s" % xvfb_process_id_file_path() - sys.exit(0) - - terminate_xvfb_process() - - os.remove(xvfb_process_id_file_path()) - os.remove(xvfb_display_number_file_path()) - -def xvfb_process_is_not_running(): - return not os.path.exists(xvfb_process_id_file_path()) - -def terminate_xvfb_process(): - process_id = xvfb_process_id() - display_number = xvfb_display_number() - - if process_id_exists(process_id): - print "Terminating Xvfb process ID %i on display %s" % (process_id, display_number) - os.kill(process_id, signal.SIGTERM) # send terminate signal - -def xvfb_process_id(): - process_id_file_path = xvfb_process_id_file_path() - process_id = open(process_id_file_path, 'r').readline().strip() - - if not process_id.isdigit(): - raise Exception("Unexpected process ID [%s] in: %s" % (process_id, process_id_file_path)) - - return int(process_id) - -def xvfb_display_number(): - return open(xvfb_display_number_file_path(), 'r').readline().strip() - -def process_id_exists(process_id): - try: - os.kill(process_id, 0) # attempt to send a harmless signal (0) to the process - return True - except OSError, os_error: - if str(os_error).endswith('No such process'): - print "Xvfb process ID %i no longer exists" % (process_id) - return False - else: - raise os_error - -def xvfb_process_id_file_path(): - return os.path.join(os.path.realpath(sys.argv[1]), XVFB_PID_FILE_NAME) - -def xvfb_display_number_file_path(): - return os.path.join(os.path.realpath(sys.argv[1]), XVFB_DISPLAY_NUMBER_FILE_NAME) - - -if __name__ == "__main__": - verify_script_parameters() - stop_xvfb_process() diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.css b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.css deleted file mode 100644 index 49c83485bd..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.css +++ /dev/null @@ -1,195 +0,0 @@ - - -/* Tables */ -table.help { margin-left: auto; margin-right: auto; } -th.summary, th.details, th.index - { text-align: left; font-size: 120%; } -th.group { text-align: left; font-size: 120%; - font-style: italic; } - -/* Documentation page titles */ -h2.module { margin-top: 0.2em; } -h2.class { margin-top: 0.2em; } -h2.type { margin-top: 0.2em; } -h2.py-src { margin-top: 0.2em; } - -/* Headings */ -h1.help { text-align: center; } -h1.heading { font-size: +140%; font-style: italic; - font-weight: bold; } -h2.heading { font-size: +125%; font-style: italic; - font-weight: bold; } -h3.heading { font-size: +110%; font-style: italic; - font-weight: normal; } -h1.tocheading { text-align: center; font-size: 105%; margin: 0; - font-weight: bold; padding: 0; } -h2.tocheading { font-size: 100%; margin: 0.5em 0 0 -0.3em; - font-weight: bold; } - -/* Table of contents */ -p.toc { margin: 0; padding: 0; } - -/* Base tree */ -pre.base-tree { font-size: 80%; margin: 0; } - -/* Summary Sections */ -p.varlist { padding: 0 0 0 7em; text-indent: -7em; - margin: 0; } -.varlist-header { font-weight: bold; } -p.imports { padding: 0 0 0 7em; text-indent: -7em; } -.imports-header { font-weight: bold; } - -/* Details Sections */ -table.func-details { border-width: 2px; border-style: groove; - padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } -h3.func-detail { margin: 0 0 1em 0; } -table.var-details { border-width: 2px; border-style: groove; - padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } -h3.var-details { margin: 0 0 1em 0; } -table.prop-details { border-width: 2px; border-style: groove; - padding: 0 1em 0 1em; margin: 0.4em 0 0 0; } -h3.prop-details { margin: 0 0 1em 0; } - -/* Function signatures */ -.sig { font-weight: bold; } - -/* Doctest blocks */ -.py-prompt { font-weight: bold;} -pre.doctestblock { padding: .5em; margin: 1em; - border-width: 1px; border-style: solid; } -table pre.doctestblock - { padding: .5em; margin: 1em; - border-width: 1px; border-style: solid; } - -/* Variable values */ -pre.variable { padding: .5em; margin: 0; - border-width: 1px; border-style: solid; } - -/* Navigation bar */ -table.navbar { border-width: 2px; border-style: groove; } -.nomargin { margin: 0; } - -/* This is used in
sections containing tables of private -values, to make them flow more seamlessly with the table that -comes before them. */ -.continue { border-top: 0; } - -/* Links */ -a.navbar { text-decoration: none; } - -/* Source Code Listings */ -pre.py-src { border: 2px solid black; } -div.highlight-hdr { border-top: 2px solid black; - border-bottom: 1px solid black; } -div.highlight { border-bottom: 2px solid black; } -a.pysrc-toggle { text-decoration: none; } -.py-line { border-left: 2px solid black; margin-left: .2em; - padding-left: .4em; } -.lineno { font-style: italic; font-size: 90%; - padding-left: .5em; } -/*a.py-name { text-decoration: none; }*/ - -/* For Graphs */ -.graph-without-title { border: none; } -.graph-with-title { border: 1px solid black; } -.graph-title { font-weight: bold; } - -/* Lists */ -ul { margin-top: 0; } - -/* Misc. */ -.footer { font-size: 85%; } -.header { font-size: 85%; } -.breadcrumbs { font-size: 85%; font-weight: bold; } -.options { font-size: 70%; } -.rtype, .ptype, .vtype - { font-size: 85%; } -dt { font-weight: bold; } -.small { font-size: 85%; } - -h2 span.codelink { font-size: 58%; font-weight: normal; } -span.codelink { font-size: 85%; font-weight; normal; } - -/* Body color */ -body { background: #ffffff; color: #000000; } - -/* Tables */ -table.summary, table.details, table.index - { background: #e8f0f8; color: #000000; } -tr.summary, tr.details, tr.index - { background: #70b0ff; color: #000000; } -th.group { background: #c0e0f8; color: #000000; } - -/* Details Sections */ -table.func-details { background: #e8f0f8; color: #000000; - border-color: #c0d0d0; } -h3.func-detail { background: transparent; color: #000000; } -table.var-details { background: #e8f0f8; color: #000000; - border-color: #c0d0d0; } -h3.var-details { background: transparent; color: #000000; } -table.prop-details { background: #e8f0f8; color: #000000; - border-color: #c0d0d0; } -h3.prop-details { background: transparent; color: #000000; } - -/* Function signatures */ -.sig { background: transparent; color: #000000; } -.sig-name { background: transparent; color: #006080; } -.sig-arg, .sig-kwarg, .sig-vararg - { background: transparent; color: #008060; } -.sig-default { background: transparent; color: #602000; } -.summary-sig { background: transparent; color: #000000; } -.summary-sig-name { background: transparent; color: #204080; } -.summary-sig-arg, .summary-sig-kwarg, .summary-sig-vararg - { background: transparent; color: #008060; } - -/* Souce code listings & doctest blocks */ -.py-src { background: transparent; color: #000000; } -.py-prompt { background: transparent; color: #005050; } -.py-string { background: transparent; color: #006030; } -.py-comment { background: transparent; color: #003060; } -.py-keyword { background: transparent; color: #600000; } -.py-output { background: transparent; color: #404040; } -.py-name { background: transparent; color: #000050; } -.py-name:link { background: transparent; color: #000050; } -.py-name:visited { background: transparent; color: #000050; } -.py-number { background: transparent; color: #005000; } -.py-def-name { background: transparent; color: #000060; - font-weight: bold; } -.py-base-class { background: transparent; color: #000060; } -.py-param { background: transparent; color: #000060; } -.py-docstring { background: transparent; color: #006030; } -.py-decorator { background: transparent; color: #804020; } - -pre.doctestblock { background: #f4faff; color: #000000; - border-color: #708890; } -table pre.doctestblock - { background: #dce4ec; color: #000000; - border-color: #708890; } -div.py-src { background: #f0f0f0; } -div.highlight-hdr { background: #d8e8e8; } -div.highlight { background: #d0e0e0; } - - -/* Variable values */ -pre.variable { background: #dce4ec; color: #000000; - border-color: #708890; } -.variable-linewrap { background: transparent; color: #604000; } -.variable-ellipsis { background: transparent; color: #604000; } -.variable-quote { background: transparent; color: #604000; } -.re { background: transparent; color: #000000; } -.re-char { background: transparent; color: #006030; } -.re-op { background: transparent; color: #600000; } -.re-group { background: transparent; color: #003060; } -.re-ref { background: transparent; color: #404040; } - -/* Navigation bar */ -table.navbar { background: #a0c0ff; color: #0000ff; - border-color: #c0d0d0; } -th.navbar { background: #a0c0ff; color: #0000ff; } -th.navselect { background: #70b0ff; color: #000000; } - -/* Links */ -a:link { background: transparent; color: #0000ff; } -a:visited { background: transparent; color: #204080; } -a.navbar:link { background: transparent; color: #0000ff; } -a.navbar:visited { background: transparent; color: #204080; } diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.js b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.js deleted file mode 100644 index c73a9b344f..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/epydoc.js +++ /dev/null @@ -1,243 +0,0 @@ -function toggle_private() { - // Search for any private/public links on this page. Store - // their old text in "cmd," so we will know what action to - // take; and change their text to the opposite action. - var cmd = "?"; - var elts = document.getElementsByTagName("a"); - for(var i=0; i...
"; - elt.innerHTML = s; - } -} - -function toggle(id) { - elt = document.getElementById(id+"-toggle"); - if (elt.innerHTML == "-") - collapse(id); - else - expand(id); -} -function highlight(id) { - var elt = document.getElementById(id+"-def"); - if (elt) elt.className = "highlight-hdr"; - var elt = document.getElementById(id+"-expanded"); - if (elt) elt.className = "highlight"; - var elt = document.getElementById(id+"-collapsed"); - if (elt) elt.className = "highlight"; -} - -function num_lines(s) { - var n = 1; - var pos = s.indexOf("\n"); - while ( pos > 0) { - n += 1; - pos = s.indexOf("\n", pos+1); - } - return n; -} - -// Collapse all blocks that mave more than `min_lines` lines. -function collapse_all(min_lines) { - var elts = document.getElementsByTagName("div"); - for (var i=0; i 0) - if (elt.id.substring(split, elt.id.length) == "-expanded") - if (num_lines(elt.innerHTML) > min_lines) - collapse(elt.id.substring(0, split)); - } -} - -function expandto(href) { - var start = href.indexOf("#")+1; - if (start != 0) { - if (href.substring(start, href.length) != "-") { - collapse_all(4); - pos = href.indexOf(".", start); - while (pos != -1) { - var id = href.substring(start, pos); - expand(id); - pos = href.indexOf(".", pos+1); - } - var id = href.substring(start, href.length); - expand(id); - highlight(id); - } - } -} - -function kill_doclink(id) { - if (id) { - var parent = document.getElementById(id); - parent.removeChild(parent.childNodes.item(0)); - } - else if (!this.contains(event.toElement)) { - var parent = document.getElementById(this.parentID); - parent.removeChild(parent.childNodes.item(0)); - } -} - -function doclink(id, name, targets) { - var elt = document.getElementById(id); - - // If we already opened the box, then destroy it. - // (This case should never occur, but leave it in just in case.) - if (elt.childNodes.length > 1) { - elt.removeChild(elt.childNodes.item(0)); - } - else { - // The outer box: relative + inline positioning. - var box1 = document.createElement("div"); - box1.style.position = "relative"; - box1.style.display = "inline"; - box1.style.top = 0; - box1.style.left = 0; - - // A shadow for fun - var shadow = document.createElement("div"); - shadow.style.position = "absolute"; - shadow.style.left = "-1.3em"; - shadow.style.top = "-1.3em"; - shadow.style.background = "#404040"; - - // The inner box: absolute positioning. - var box2 = document.createElement("div"); - box2.style.position = "relative"; - box2.style.border = "1px solid #a0a0a0"; - box2.style.left = "-.2em"; - box2.style.top = "-.2em"; - box2.style.background = "white"; - box2.style.padding = ".3em .4em .3em .4em"; - box2.style.fontStyle = "normal"; - box2.onmouseout=kill_doclink; - box2.parentID = id; - - var links = ""; - target_list = targets.split(","); - for (var i=0; i" + - target[0] + ""; - } - - // Put it all together. - elt.insertBefore(box1, elt.childNodes.item(0)); - //box1.appendChild(box2); - box1.appendChild(shadow); - shadow.appendChild(box2); - box2.innerHTML = - "Which "+name+" do you want to see documentation for?" + - ""; - } -} - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/frames.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/frames.html deleted file mode 100644 index 08e545511b..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/frames.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - API Documentation - - - - - - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/help.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/help.html deleted file mode 100644 index c845e898d2..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/help.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - Help - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
- -

API Documentation

- -

This document contains the API (Application Programming Interface) -documentation for this project. Documentation for the Python -objects defined by the project is divided into separate pages for each -package, module, and class. The API documentation also includes two -pages containing information about the project as a whole: a trees -page, and an index page.

- -

Object Documentation

- -

Each Package Documentation page contains:

-
    -
  • A description of the package.
  • -
  • A list of the modules and sub-packages contained by the - package.
  • -
  • A summary of the classes defined by the package.
  • -
  • A summary of the functions defined by the package.
  • -
  • A summary of the variables defined by the package.
  • -
  • A detailed description of each function defined by the - package.
  • -
  • A detailed description of each variable defined by the - package.
  • -
- -

Each Module Documentation page contains:

-
    -
  • A description of the module.
  • -
  • A summary of the classes defined by the module.
  • -
  • A summary of the functions defined by the module.
  • -
  • A summary of the variables defined by the module.
  • -
  • A detailed description of each function defined by the - module.
  • -
  • A detailed description of each variable defined by the - module.
  • -
- -

Each Class Documentation page contains:

-
    -
  • A class inheritance diagram.
  • -
  • A list of known subclasses.
  • -
  • A description of the class.
  • -
  • A summary of the methods defined by the class.
  • -
  • A summary of the instance variables defined by the class.
  • -
  • A summary of the class (static) variables defined by the - class.
  • -
  • A detailed description of each method defined by the - class.
  • -
  • A detailed description of each instance variable defined by the - class.
  • -
  • A detailed description of each class (static) variable defined - by the class.
  • -
- -

Project Documentation

- -

The Trees page contains the module and class hierarchies:

-
    -
  • The module hierarchy lists every package and module, with - modules grouped into packages. At the top level, and within each - package, modules and sub-packages are listed alphabetically.
  • -
  • The class hierarchy lists every class, grouped by base - class. If a class has more than one base class, then it will be - listed under each base class. At the top level, and under each base - class, classes are listed alphabetically.
  • -
- -

The Index page contains indices of terms and - identifiers:

-
    -
  • The term index lists every term indexed by any object's - documentation. For each term, the index provides links to each - place where the term is indexed.
  • -
  • The identifier index lists the (short) name of every package, - module, class, method, function, variable, and parameter. For each - identifier, the index provides a short description, and a link to - its documentation.
  • -
- -

The Table of Contents

- -

The table of contents occupies the two frames on the left side of -the window. The upper-left frame displays the project -contents, and the lower-left frame displays the module -contents:

- - - - - - - - - -
- Project
Contents
...
- API
Documentation
Frame


-
- Module
Contents
 
...
  -

- -

The project contents frame contains a list of all packages -and modules that are defined by the project. Clicking on an entry -will display its contents in the module contents frame. Clicking on a -special entry, labeled "Everything," will display the contents of -the entire project.

- -

The module contents frame contains a list of every -submodule, class, type, exception, function, and variable defined by a -module or package. Clicking on an entry will display its -documentation in the API documentation frame. Clicking on the name of -the module, at the top of the frame, will display the documentation -for the module itself.

- -

The "frames" and "no frames" buttons below the top -navigation bar can be used to control whether the table of contents is -displayed or not.

- -

The Navigation Bar

- -

A navigation bar is located at the top and bottom of every page. -It indicates what type of page you are currently viewing, and allows -you to go to related pages. The following table describes the labels -on the navigation bar. Note that not some labels (such as -[Parent]) are not displayed on all pages.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LabelHighlighted when...Links to...
[Parent](never highlighted) the parent of the current package
[Package]viewing a packagethe package containing the current object -
[Module]viewing a modulethe module containing the current object -
[Class]viewing a class the class containing the current object
[Trees]viewing the trees page the trees page
[Index]viewing the index page the index page
[Help]viewing the help page the help page
- -

The "show private" and "hide private" buttons below -the top navigation bar can be used to control whether documentation -for private objects is displayed. Private objects are usually defined -as objects whose (short) names begin with a single underscore, but do -not end with an underscore. For example, "_x", -"__pprint", and "epydoc.epytext._tokenize" -are private objects; but "re.sub", -"__init__", and "type_" are not. However, -if a module defines the "__all__" variable, then its -contents are used to decide which objects are private.

- -

A timestamp below the bottom navigation bar indicates when each -page was last updated.

- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/index.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/index.html deleted file mode 100644 index 08e545511b..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - API Documentation - - - - - - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/indices.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/indices.html deleted file mode 100644 index b8d41e5c2c..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/indices.html +++ /dev/null @@ -1,1268 +0,0 @@ - - - - - Index - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
Identifier Index [ - _ - a - b - c - d - e - f - g - h - i - j - k - l - m - n - o - p - q - r - s - t - u - v - w - x - y - z - ]
-
- __init__ - Method - in Class selenium.selenium -
- - add_location_strategy - Method - in Class selenium.selenium -
- add_script - Method - in Class selenium.selenium -
- add_selection - Method - in Class selenium.selenium -
- addCustomRequestHeader - Method - in Class selenium.selenium -
- allow_native_xpath - Method - in Class selenium.selenium -
- alt_key_down - Method - in Class selenium.selenium -
- alt_key_up - Method - in Class selenium.selenium -
- answer_on_next_prompt - Method - in Class selenium.selenium -
- assign_id - Method - in Class selenium.selenium -
- attach_file - Method - in Class selenium.selenium -
- - - capture_entire_page_screenshot - Method - in Class selenium.selenium -
- capture_entire_page_screenshot_to_string - Method - in Class selenium.selenium -
- capture_screenshot - Method - in Class selenium.selenium -
- capture_screenshot_to_string - Method - in Class selenium.selenium -
- captureNetworkTraffic - Method - in Class selenium.selenium -
- check - Method - in Class selenium.selenium -
- choose_cancel_on_next_confirmation - Method - in Class selenium.selenium -
- choose_ok_on_next_confirmation - Method - in Class selenium.selenium -
- click - Method - in Class selenium.selenium -
- click_at - Method - in Class selenium.selenium -
- close - Method - in Class selenium.selenium -
- context_menu - Method - in Class selenium.selenium -
- context_menu_at - Method - in Class selenium.selenium -
- control_key_down - Method - in Class selenium.selenium -
- control_key_up - Method - in Class selenium.selenium -
- create_cookie - Method - in Class selenium.selenium -
- - delete_all_visible_cookies - Method - in Class selenium.selenium -
- delete_cookie - Method - in Class selenium.selenium -
- deselect_pop_up - Method - in Class selenium.selenium -
- do_command - Method - in Class selenium.selenium -
- double_click - Method - in Class selenium.selenium -
- double_click_at - Method - in Class selenium.selenium -
- drag_and_drop - Method - in Class selenium.selenium -
- drag_and_drop_to_object - Method - in Class selenium.selenium -
- dragdrop - Method - in Class selenium.selenium -
- - - fire_event - Method - in Class selenium.selenium -
- focus - Method - in Class selenium.selenium -
- - get_alert - Method - in Class selenium.selenium -
- get_all_buttons - Method - in Class selenium.selenium -
- get_all_fields - Method - in Class selenium.selenium -
- get_all_links - Method - in Class selenium.selenium -
- get_all_window_ids - Method - in Class selenium.selenium -
- get_all_window_names - Method - in Class selenium.selenium -
- get_all_window_titles - Method - in Class selenium.selenium -
- get_attribute - Method - in Class selenium.selenium -
- get_attribute_from_all_windows - Method - in Class selenium.selenium -
- get_body_text - Method - in Class selenium.selenium -
- get_boolean - Method - in Class selenium.selenium -
- get_boolean_array - Method - in Class selenium.selenium -
- get_confirmation - Method - in Class selenium.selenium -
- get_cookie - Method - in Class selenium.selenium -
- get_cookie_by_name - Method - in Class selenium.selenium -
- get_cursor_position - Method - in Class selenium.selenium -
- get_element_height - Method - in Class selenium.selenium -
- get_element_index - Method - in Class selenium.selenium -
- get_element_position_left - Method - in Class selenium.selenium -
- get_element_position_top - Method - in Class selenium.selenium -
- get_element_width - Method - in Class selenium.selenium -
- get_eval - Method - in Class selenium.selenium -
- get_expression - Method - in Class selenium.selenium -
- get_html_source - Method - in Class selenium.selenium -
- get_location - Method - in Class selenium.selenium -
- get_mouse_speed - Method - in Class selenium.selenium -
- get_number - Method - in Class selenium.selenium -
- get_number_array - Method - in Class selenium.selenium -
- get_prompt - Method - in Class selenium.selenium -
- get_select_options - Method - in Class selenium.selenium -
- get_selected_id - Method - in Class selenium.selenium -
- get_selected_ids - Method - in Class selenium.selenium -
- get_selected_index - Method - in Class selenium.selenium -
- get_selected_indexes - Method - in Class selenium.selenium -
- get_selected_label - Method - in Class selenium.selenium -
- get_selected_labels - Method - in Class selenium.selenium -
- get_selected_value - Method - in Class selenium.selenium -
- get_selected_values - Method - in Class selenium.selenium -
- get_speed - Method - in Class selenium.selenium -
- get_string - Method - in Class selenium.selenium -
- get_string_array - Method - in Class selenium.selenium -
- get_table - Method - in Class selenium.selenium -
- get_text - Method - in Class selenium.selenium -
- get_title - Method - in Class selenium.selenium -
- get_value - Method - in Class selenium.selenium -
- get_whether_this_frame_match_frame_expression - Method - in Class selenium.selenium -
- get_whether_this_window_match_window_expression - Method - in Class selenium.selenium -
- get_xpath_count - Method - in Class selenium.selenium -
- go_back - Method - in Class selenium.selenium -
- - highlight - Method - in Class selenium.selenium -
- - ignore_attributes_without_value - Method - in Class selenium.selenium -
- is_alert_present - Method - in Class selenium.selenium -
- is_checked - Method - in Class selenium.selenium -
- is_confirmation_present - Method - in Class selenium.selenium -
- is_cookie_present - Method - in Class selenium.selenium -
- is_editable - Method - in Class selenium.selenium -
- is_element_present - Method - in Class selenium.selenium -
- is_ordered - Method - in Class selenium.selenium -
- is_prompt_present - Method - in Class selenium.selenium -
- is_something_selected - Method - in Class selenium.selenium -
- is_text_present - Method - in Class selenium.selenium -
- is_visible - Method - in Class selenium.selenium -
- - - key_down - Method - in Class selenium.selenium -
- key_down_native - Method - in Class selenium.selenium -
- key_press - Method - in Class selenium.selenium -
- key_press_native - Method - in Class selenium.selenium -
- key_up - Method - in Class selenium.selenium -
- key_up_native - Method - in Class selenium.selenium -
- - - meta_key_down - Method - in Class selenium.selenium -
- meta_key_up - Method - in Class selenium.selenium -
- mouse_down - Method - in Class selenium.selenium -
- mouse_down_at - Method - in Class selenium.selenium -
- mouse_down_right - Method - in Class selenium.selenium -
- mouse_down_right_at - Method - in Class selenium.selenium -
- mouse_move - Method - in Class selenium.selenium -
- mouse_move_at - Method - in Class selenium.selenium -
- mouse_out - Method - in Class selenium.selenium -
- mouse_over - Method - in Class selenium.selenium -
- mouse_up - Method - in Class selenium.selenium -
- mouse_up_at - Method - in Class selenium.selenium -
- mouse_up_right - Method - in Class selenium.selenium -
- mouse_up_right_at - Method - in Class selenium.selenium -
- - - open - Method - in Class selenium.selenium -
- open_window - Method - in Class selenium.selenium -
- - - - refresh - Method - in Class selenium.selenium -
- remove_all_selections - Method - in Class selenium.selenium -
- remove_script - Method - in Class selenium.selenium -
- remove_selection - Method - in Class selenium.selenium -
- retrieve_last_remote_control_logs - Method - in Class selenium.selenium -
- rollup - Method - in Class selenium.selenium -
- run_script - Method - in Class selenium.selenium -
- - select - Method - in Class selenium.selenium -
- select_frame - Method - in Class selenium.selenium -
- select_pop_up - Method - in Class selenium.selenium -
- select_window - Method - in Class selenium.selenium -
- selenium - Module -
- selenium - Class - in Module selenium -
- set_browser_log_level - Method - in Class selenium.selenium -
- set_context - Method - in Class selenium.selenium -
- set_cursor_position - Method - in Class selenium.selenium -
- set_mouse_speed - Method - in Class selenium.selenium -
- set_speed - Method - in Class selenium.selenium -
- set_timeout - Method - in Class selenium.selenium -
- setExtensionJs - Method - in Class selenium.selenium -
- shift_key_down - Method - in Class selenium.selenium -
- shift_key_up - Method - in Class selenium.selenium -
- shut_down_selenium_server - Method - in Class selenium.selenium -
- start - Method - in Class selenium.selenium -
- stop - Method - in Class selenium.selenium -
- submit - Method - in Class selenium.selenium -
- - type - Method - in Class selenium.selenium -
- type_keys - Method - in Class selenium.selenium -
- - uncheck - Method - in Class selenium.selenium -
- use_xpath_library - Method - in Class selenium.selenium -
- - - wait_for_condition - Method - in Class selenium.selenium -
- wait_for_frame_to_load - Method - in Class selenium.selenium -
- wait_for_page_to_load - Method - in Class selenium.selenium -
- wait_for_pop_up - Method - in Class selenium.selenium -
- window_focus - Method - in Class selenium.selenium -
- window_maximize - Method - in Class selenium.selenium -
- - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-module.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-module.html deleted file mode 100644 index d3237f651e..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-module.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - selenium - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Module selenium - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Module selenium -
source code

-

Copyright 2006 ThoughtWorks, Inc.

-

Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at

-
-http://www.apache.org/licenses/LICENSE-2.0
-

Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License.



- - - - - - - - - - - -
- - - - - -
Classes[hide private]
-
- seleniumDefines an object that runs Selenium commands.
- -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-pysrc.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-pysrc.html deleted file mode 100644 index a07c88358c..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium-pysrc.html +++ /dev/null @@ -1,2181 +0,0 @@ - - - - - selenium - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Module selenium - - - - - - -
[hide private]
[frames] | no frames]
-
-

Source Code for Module selenium

-
-
-   1   
-   2  """ 
-   3  Copyright 2006 ThoughtWorks, Inc. 
-   4   
-   5  Licensed under the Apache License, Version 2.0 (the "License"); 
-   6  you may not use this file except in compliance with the License. 
-   7  You may obtain a copy of the License at 
-   8   
-   9      http://www.apache.org/licenses/LICENSE-2.0 
-  10   
-  11  Unless required by applicable law or agreed to in writing, software 
-  12  distributed under the License is distributed on an "AS IS" BASIS, 
-  13  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-  14  See the License for the specific language governing permissions and 
-  15  limitations under the License. 
-  16  """ 
-  17  __docformat__ = "restructuredtext en" 
-  18   
-  19  # This file has been automatically generated via XSL 
-  20   
-  21  import httplib 
-  22  import urllib 
-  23  import re 
-  24   
-
25 -class selenium: -
26 """ - 27 Defines an object that runs Selenium commands. - 28 - 29 Element Locators - 30 ~~~~~~~~~~~~~~~~ - 31 - 32 Element Locators tell Selenium which HTML element a command refers to. - 33 The format of a locator is: - 34 - 35 \ *locatorType*\ **=**\ \ *argument* - 36 - 37 - 38 We support the following strategies for locating elements: - 39 - 40 - 41 * \ **identifier**\ =\ *id*: - 42 Select the element with the specified @id attribute. If no match is - 43 found, select the first element whose @name attribute is \ *id*. - 44 (This is normally the default; see below.) - 45 * \ **id**\ =\ *id*: - 46 Select the element with the specified @id attribute. - 47 * \ **name**\ =\ *name*: - 48 Select the first element with the specified @name attribute. - 49 - 50 * username - 51 * name=username - 52 - 53 - 54 The name may optionally be followed by one or more \ *element-filters*, separated from the name by whitespace. If the \ *filterType* is not specified, \ **value**\ is assumed. - 55 - 56 * name=flavour value=chocolate - 57 - 58 - 59 * \ **dom**\ =\ *javascriptExpression*: - 60 - 61 Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object - 62 Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block. - 63 - 64 * dom=document.forms['myForm'].myDropdown - 65 * dom=document.images[56] - 66 * dom=function foo() { return document.links[1]; }; foo(); - 67 - 68 - 69 * \ **xpath**\ =\ *xpathExpression*: - 70 Locate an element using an XPath expression. - 71 - 72 * xpath=//img[@alt='The image alt text'] - 73 * xpath=//table[@id='table1']//tr[4]/td[2] - 74 * xpath=//a[contains(@href,'#id1')] - 75 * xpath=//a[contains(@href,'#id1')]/@class - 76 * xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td - 77 * xpath=//input[@name='name2' and @value='yes'] - 78 * xpath=//\*[text()="right"] - 79 - 80 - 81 * \ **link**\ =\ *textPattern*: - 82 Select the link (anchor) element which contains text matching the - 83 specified \ *pattern*. - 84 - 85 * link=The link text - 86 - 87 - 88 * \ **css**\ =\ *cssSelectorSyntax*: - 89 Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package. - 90 - 91 * css=a[href="#id3"] - 92 * css=span#firstChild + span - 93 - 94 - 95 Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). - 96 - 97 * \ **ui**\ =\ *uiSpecifierString*: - 98 Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details. - 99 - 100 * ui=loginPages::loginButton() - 101 * ui=settingsPages::toggle(label=Hide Email) - 102 * ui=forumPages::postBody(index=2)//a[2] - 103 - 104 - 105 - 106 - 107 - 108 Without an explicit locator prefix, Selenium uses the following default - 109 strategies: - 110 - 111 - 112 * \ **dom**\ , for locators starting with "document." - 113 * \ **xpath**\ , for locators starting with "//" - 114 * \ **identifier**\ , otherwise - 115 - 116 Element Filters - 117 ~~~~~~~~~~~~~~~ - 118 - 119 Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator. - 120 - 121 Filters look much like locators, ie. - 122 - 123 \ *filterType*\ **=**\ \ *argument* - 124 - 125 Supported element-filters are: - 126 - 127 \ **value=**\ \ *valuePattern* - 128 - 129 - 130 Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons. - 131 - 132 \ **index=**\ \ *index* - 133 - 134 - 135 Selects a single element based on its position in the list (offset from zero). - 136 - 137 String-match Patterns - 138 ~~~~~~~~~~~~~~~~~~~~~ - 139 - 140 Various Pattern syntaxes are available for matching string values: - 141 - 142 - 143 * \ **glob:**\ \ *pattern*: - 144 Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a - 145 kind of limited regular-expression syntax typically used in command-line - 146 shells. In a glob pattern, "\*" represents any sequence of characters, and "?" - 147 represents any single character. Glob patterns match against the entire - 148 string. - 149 * \ **regexp:**\ \ *regexp*: - 150 Match a string using a regular-expression. The full power of JavaScript - 151 regular-expressions is available. - 152 * \ **regexpi:**\ \ *regexpi*: - 153 Match a string using a case-insensitive regular-expression. - 154 * \ **exact:**\ \ *string*: - 155 - 156 Match a string exactly, verbatim, without any of that fancy wildcard - 157 stuff. - 158 - 159 - 160 - 161 If no pattern prefix is specified, Selenium assumes that it's a "glob" - 162 pattern. - 163 - 164 - 165 - 166 For commands that return multiple values (such as verifySelectOptions), - 167 the string being matched is a comma-separated list of the return values, - 168 where both commas and backslashes in the values are backslash-escaped. - 169 When providing a pattern, the optional matching syntax (i.e. glob, - 170 regexp, etc.) is specified once, as usual, at the beginning of the - 171 pattern. - 172 - 173 - 174 """ - 175 - 176 ### This part is hard-coded in the XSL -
177 - def __init__(self, host, port, browserStartCommand, browserURL): -
178 self.host = host - 179 self.port = port - 180 self.browserStartCommand = browserStartCommand - 181 self.browserURL = browserURL - 182 self.sessionId = None - 183 self.extensionJs = "" -
184 -
185 - def setExtensionJs(self, extensionJs): -
186 self.extensionJs = extensionJs -
187 -
188 - def start(self): -
189 result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL, self.extensionJs]) - 190 try: - 191 self.sessionId = result - 192 except ValueError: - 193 raise Exception, result -
194 -
195 - def stop(self): -
196 self.do_command("testComplete", []) - 197 self.sessionId = None -
198 -
199 - def do_command(self, verb, args): -
200 conn = httplib.HTTPConnection(self.host, self.port) - 201 body = u'cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8')) - 202 for i in range(len(args)): - 203 body += '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8')) - 204 if (None != self.sessionId): - 205 body += "&sessionId=" + unicode(self.sessionId) - 206 headers = {"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"} - 207 conn.request("POST", "/selenium-server/driver/", body, headers) - 208 - 209 response = conn.getresponse() - 210 #print response.status, response.reason - 211 data = unicode(response.read(), "UTF-8") - 212 result = response.reason - 213 #print "Selenium Result: " + repr(data) + "\n\n" - 214 if (not data.startswith('OK')): - 215 raise Exception, data - 216 return data -
217 -
218 - def get_string(self, verb, args): -
219 result = self.do_command(verb, args) - 220 return result[3:] -
221 -
222 - def get_string_array(self, verb, args): -
223 csv = self.get_string(verb, args) - 224 token = "" - 225 tokens = [] - 226 escape = False - 227 for i in range(len(csv)): - 228 letter = csv[i] - 229 if (escape): - 230 token = token + letter - 231 escape = False - 232 continue - 233 if (letter == '\\'): - 234 escape = True - 235 elif (letter == ','): - 236 tokens.append(token) - 237 token = "" - 238 else: - 239 token = token + letter - 240 tokens.append(token) - 241 return tokens -
242 -
243 - def get_number(self, verb, args): -
244 # Is there something I need to do here? - 245 return self.get_string(verb, args) -
246 -
247 - def get_number_array(self, verb, args): -
248 # Is there something I need to do here? - 249 return self.get_string_array(verb, args) -
250 -
251 - def get_boolean(self, verb, args): -
252 boolstr = self.get_string(verb, args) - 253 if ("true" == boolstr): - 254 return True - 255 if ("false" == boolstr): - 256 return False - 257 raise ValueError, "result is neither 'true' nor 'false': " + boolstr -
258 -
259 - def get_boolean_array(self, verb, args): -
260 boolarr = self.get_string_array(verb, args) - 261 for i in range(len(boolarr)): - 262 if ("true" == boolstr): - 263 boolarr[i] = True - 264 continue - 265 if ("false" == boolstr): - 266 boolarr[i] = False - 267 continue - 268 raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i] - 269 return boolarr -
270 - 271 - 272 - 273 ### From here on, everything's auto-generated from XML - 274 - 275 -
276 - def click(self,locator): -
277 """ - 278 Clicks on a link, button, checkbox or radio button. If the click action - 279 causes a new page to load (like a link usually does), call - 280 waitForPageToLoad. - 281 - 282 'locator' is an element locator - 283 """ - 284 self.do_command("click", [locator,]) -
285 - 286 -
287 - def double_click(self,locator): -
288 """ - 289 Double clicks on a link, button, checkbox or radio button. If the double click action - 290 causes a new page to load (like a link usually does), call - 291 waitForPageToLoad. - 292 - 293 'locator' is an element locator - 294 """ - 295 self.do_command("doubleClick", [locator,]) -
296 - 297 -
298 - def context_menu(self,locator): -
299 """ - 300 Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - 301 - 302 'locator' is an element locator - 303 """ - 304 self.do_command("contextMenu", [locator,]) -
305 - 306 -
307 - def click_at(self,locator,coordString): -
308 """ - 309 Clicks on a link, button, checkbox or radio button. If the click action - 310 causes a new page to load (like a link usually does), call - 311 waitForPageToLoad. - 312 - 313 'locator' is an element locator - 314 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 315 """ - 316 self.do_command("clickAt", [locator,coordString,]) -
317 - 318 -
319 - def double_click_at(self,locator,coordString): -
320 """ - 321 Doubleclicks on a link, button, checkbox or radio button. If the action - 322 causes a new page to load (like a link usually does), call - 323 waitForPageToLoad. - 324 - 325 'locator' is an element locator - 326 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 327 """ - 328 self.do_command("doubleClickAt", [locator,coordString,]) -
329 - 330 -
331 - def context_menu_at(self,locator,coordString): -
332 """ - 333 Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - 334 - 335 'locator' is an element locator - 336 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 337 """ - 338 self.do_command("contextMenuAt", [locator,coordString,]) -
339 - 340 -
341 - def fire_event(self,locator,eventName): -
342 """ - 343 Explicitly simulate an event, to trigger the corresponding "on\ *event*" - 344 handler. - 345 - 346 'locator' is an element locator - 347 'eventName' is the event name, e.g. "focus" or "blur" - 348 """ - 349 self.do_command("fireEvent", [locator,eventName,]) -
350 - 351 -
352 - def focus(self,locator): -
353 """ - 354 Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. - 355 - 356 'locator' is an element locator - 357 """ - 358 self.do_command("focus", [locator,]) -
359 - 360 -
361 - def key_press(self,locator,keySequence): -
362 """ - 363 Simulates a user pressing and releasing a key. - 364 - 365 'locator' is an element locator - 366 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - 367 """ - 368 self.do_command("keyPress", [locator,keySequence,]) -
369 - 370 -
371 - def shift_key_down(self): -
372 """ - 373 Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. - 374 - 375 """ - 376 self.do_command("shiftKeyDown", []) -
377 - 378 -
379 - def shift_key_up(self): -
380 """ - 381 Release the shift key. - 382 - 383 """ - 384 self.do_command("shiftKeyUp", []) -
385 - 386 -
387 - def meta_key_down(self): -
388 """ - 389 Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. - 390 - 391 """ - 392 self.do_command("metaKeyDown", []) -
393 - 394 -
395 - def meta_key_up(self): -
396 """ - 397 Release the meta key. - 398 - 399 """ - 400 self.do_command("metaKeyUp", []) -
401 - 402 -
403 - def alt_key_down(self): -
404 """ - 405 Press the alt key and hold it down until doAltUp() is called or a new page is loaded. - 406 - 407 """ - 408 self.do_command("altKeyDown", []) -
409 - 410 -
411 - def alt_key_up(self): -
412 """ - 413 Release the alt key. - 414 - 415 """ - 416 self.do_command("altKeyUp", []) -
417 - 418 -
419 - def control_key_down(self): -
420 """ - 421 Press the control key and hold it down until doControlUp() is called or a new page is loaded. - 422 - 423 """ - 424 self.do_command("controlKeyDown", []) -
425 - 426 -
427 - def control_key_up(self): -
428 """ - 429 Release the control key. - 430 - 431 """ - 432 self.do_command("controlKeyUp", []) -
433 - 434 -
435 - def key_down(self,locator,keySequence): -
436 """ - 437 Simulates a user pressing a key (without releasing it yet). - 438 - 439 'locator' is an element locator - 440 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - 441 """ - 442 self.do_command("keyDown", [locator,keySequence,]) -
443 - 444 -
445 - def key_up(self,locator,keySequence): -
446 """ - 447 Simulates a user releasing a key. - 448 - 449 'locator' is an element locator - 450 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - 451 """ - 452 self.do_command("keyUp", [locator,keySequence,]) -
453 - 454 -
455 - def mouse_over(self,locator): -
456 """ - 457 Simulates a user hovering a mouse over the specified element. - 458 - 459 'locator' is an element locator - 460 """ - 461 self.do_command("mouseOver", [locator,]) -
462 - 463 -
464 - def mouse_out(self,locator): -
465 """ - 466 Simulates a user moving the mouse pointer away from the specified element. - 467 - 468 'locator' is an element locator - 469 """ - 470 self.do_command("mouseOut", [locator,]) -
471 - 472 -
473 - def mouse_down(self,locator): -
474 """ - 475 Simulates a user pressing the left mouse button (without releasing it yet) on - 476 the specified element. - 477 - 478 'locator' is an element locator - 479 """ - 480 self.do_command("mouseDown", [locator,]) -
481 - 482 -
483 - def mouse_down_right(self,locator): -
484 """ - 485 Simulates a user pressing the right mouse button (without releasing it yet) on - 486 the specified element. - 487 - 488 'locator' is an element locator - 489 """ - 490 self.do_command("mouseDownRight", [locator,]) -
491 - 492 -
493 - def mouse_down_at(self,locator,coordString): -
494 """ - 495 Simulates a user pressing the left mouse button (without releasing it yet) at - 496 the specified location. - 497 - 498 'locator' is an element locator - 499 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 500 """ - 501 self.do_command("mouseDownAt", [locator,coordString,]) -
502 - 503 -
504 - def mouse_down_right_at(self,locator,coordString): -
505 """ - 506 Simulates a user pressing the right mouse button (without releasing it yet) at - 507 the specified location. - 508 - 509 'locator' is an element locator - 510 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 511 """ - 512 self.do_command("mouseDownRightAt", [locator,coordString,]) -
513 - 514 -
515 - def mouse_up(self,locator): -
516 """ - 517 Simulates the event that occurs when the user releases the mouse button (i.e., stops - 518 holding the button down) on the specified element. - 519 - 520 'locator' is an element locator - 521 """ - 522 self.do_command("mouseUp", [locator,]) -
523 - 524 -
525 - def mouse_up_right(self,locator): -
526 """ - 527 Simulates the event that occurs when the user releases the right mouse button (i.e., stops - 528 holding the button down) on the specified element. - 529 - 530 'locator' is an element locator - 531 """ - 532 self.do_command("mouseUpRight", [locator,]) -
533 - 534 -
535 - def mouse_up_at(self,locator,coordString): -
536 """ - 537 Simulates the event that occurs when the user releases the mouse button (i.e., stops - 538 holding the button down) at the specified location. - 539 - 540 'locator' is an element locator - 541 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 542 """ - 543 self.do_command("mouseUpAt", [locator,coordString,]) -
544 - 545 -
546 - def mouse_up_right_at(self,locator,coordString): -
547 """ - 548 Simulates the event that occurs when the user releases the right mouse button (i.e., stops - 549 holding the button down) at the specified location. - 550 - 551 'locator' is an element locator - 552 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 553 """ - 554 self.do_command("mouseUpRightAt", [locator,coordString,]) -
555 - 556 -
557 - def mouse_move(self,locator): -
558 """ - 559 Simulates a user pressing the mouse button (without releasing it yet) on - 560 the specified element. - 561 - 562 'locator' is an element locator - 563 """ - 564 self.do_command("mouseMove", [locator,]) -
565 - 566 -
567 - def mouse_move_at(self,locator,coordString): -
568 """ - 569 Simulates a user pressing the mouse button (without releasing it yet) on - 570 the specified element. - 571 - 572 'locator' is an element locator - 573 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - 574 """ - 575 self.do_command("mouseMoveAt", [locator,coordString,]) -
576 - 577 -
578 - def type(self,locator,value): -
579 """ - 580 Sets the value of an input field, as though you typed it in. - 581 - 582 - 583 Can also be used to set the value of combo boxes, check boxes, etc. In these cases, - 584 value should be the value of the option selected, not the visible text. - 585 - 586 - 587 'locator' is an element locator - 588 'value' is the value to type - 589 """ - 590 self.do_command("type", [locator,value,]) -
591 - 592 -
593 - def type_keys(self,locator,value): -
594 """ - 595 Simulates keystroke events on the specified element, as though you typed the value key-by-key. - 596 - 597 - 598 This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; - 599 this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events. - 600 - 601 Unlike the simple "type" command, which forces the specified value into the page directly, this command - 602 may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. - 603 For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in - 604 the field. - 605 - 606 In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to - 607 send the keystroke events corresponding to what you just typed. - 608 - 609 - 610 'locator' is an element locator - 611 'value' is the value to type - 612 """ - 613 self.do_command("typeKeys", [locator,value,]) -
614 - 615 -
616 - def set_speed(self,value): -
617 """ - 618 Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., - 619 the delay is 0 milliseconds. - 620 - 621 'value' is the number of milliseconds to pause after operation - 622 """ - 623 self.do_command("setSpeed", [value,]) -
624 - 625 -
626 - def get_speed(self): -
627 """ - 628 Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., - 629 the delay is 0 milliseconds. - 630 - 631 See also setSpeed. - 632 - 633 """ - 634 return self.get_string("getSpeed", []) -
635 - 636 -
637 - def check(self,locator): -
638 """ - 639 Check a toggle-button (checkbox/radio) - 640 - 641 'locator' is an element locator - 642 """ - 643 self.do_command("check", [locator,]) -
644 - 645 -
646 - def uncheck(self,locator): -
647 """ - 648 Uncheck a toggle-button (checkbox/radio) - 649 - 650 'locator' is an element locator - 651 """ - 652 self.do_command("uncheck", [locator,]) -
653 - 654 -
655 - def select(self,selectLocator,optionLocator): -
656 """ - 657 Select an option from a drop-down using an option locator. - 658 - 659 - 660 - 661 Option locators provide different ways of specifying options of an HTML - 662 Select element (e.g. for selecting a specific option, or for asserting - 663 that the selected option satisfies a specification). There are several - 664 forms of Select Option Locator. - 665 - 666 - 667 * \ **label**\ =\ *labelPattern*: - 668 matches options based on their labels, i.e. the visible text. (This - 669 is the default.) - 670 - 671 * label=regexp:^[Oo]ther - 672 - 673 - 674 * \ **value**\ =\ *valuePattern*: - 675 matches options based on their values. - 676 - 677 * value=other - 678 - 679 - 680 * \ **id**\ =\ *id*: - 681 - 682 matches options based on their ids. - 683 - 684 * id=option1 - 685 - 686 - 687 * \ **index**\ =\ *index*: - 688 matches an option based on its index (offset from zero). - 689 - 690 * index=2 - 691 - 692 - 693 - 694 - 695 - 696 If no option locator prefix is provided, the default behaviour is to match on \ **label**\ . - 697 - 698 - 699 - 700 'selectLocator' is an element locator identifying a drop-down menu - 701 'optionLocator' is an option locator (a label by default) - 702 """ - 703 self.do_command("select", [selectLocator,optionLocator,]) -
704 - 705 -
706 - def add_selection(self,locator,optionLocator): -
707 """ - 708 Add a selection to the set of selected options in a multi-select element using an option locator. - 709 - 710 @see #doSelect for details of option locators - 711 - 712 'locator' is an element locator identifying a multi-select box - 713 'optionLocator' is an option locator (a label by default) - 714 """ - 715 self.do_command("addSelection", [locator,optionLocator,]) -
716 - 717 -
718 - def remove_selection(self,locator,optionLocator): -
719 """ - 720 Remove a selection from the set of selected options in a multi-select element using an option locator. - 721 - 722 @see #doSelect for details of option locators - 723 - 724 'locator' is an element locator identifying a multi-select box - 725 'optionLocator' is an option locator (a label by default) - 726 """ - 727 self.do_command("removeSelection", [locator,optionLocator,]) -
728 - 729 -
730 - def remove_all_selections(self,locator): -
731 """ - 732 Unselects all of the selected options in a multi-select element. - 733 - 734 'locator' is an element locator identifying a multi-select box - 735 """ - 736 self.do_command("removeAllSelections", [locator,]) -
737 - 738 -
739 - def submit(self,formLocator): -
740 """ - 741 Submit the specified form. This is particularly useful for forms without - 742 submit buttons, e.g. single-input "Search" forms. - 743 - 744 'formLocator' is an element locator for the form you want to submit - 745 """ - 746 self.do_command("submit", [formLocator,]) -
747 - 748 -
749 - def open(self,url): -
750 """ - 751 Opens an URL in the test frame. This accepts both relative and absolute - 752 URLs. - 753 - 754 The "open" command waits for the page to load before proceeding, - 755 ie. the "AndWait" suffix is implicit. - 756 - 757 \ *Note*: The URL must be on the same domain as the runner HTML - 758 due to security restrictions in the browser (Same Origin Policy). If you - 759 need to open an URL on another domain, use the Selenium Server to start a - 760 new browser session on that domain. - 761 - 762 'url' is the URL to open; may be relative or absolute - 763 """ - 764 self.do_command("open", [url,]) -
765 - 766 -
767 - def open_window(self,url,windowID): -
768 """ - 769 Opens a popup window (if a window with that ID isn't already open). - 770 After opening the window, you'll need to select it using the selectWindow - 771 command. - 772 - 773 - 774 This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - 775 In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - 776 an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - 777 - 778 - 779 'url' is the URL to open, which can be blank - 780 'windowID' is the JavaScript window ID of the window to select - 781 """ - 782 self.do_command("openWindow", [url,windowID,]) -
783 - 784 -
785 - def select_window(self,windowID): -
786 """ - 787 Selects a popup window using a window locator; once a popup window has been selected, all - 788 commands go to that window. To select the main window again, use null - 789 as the target. - 790 - 791 - 792 - 793 - 794 Window locators provide different ways of specifying the window object: - 795 by title, by internal JavaScript "name," or by JavaScript variable. - 796 - 797 - 798 * \ **title**\ =\ *My Special Window*: - 799 Finds the window using the text that appears in the title bar. Be careful; - 800 two windows can share the same title. If that happens, this locator will - 801 just pick one. - 802 - 803 * \ **name**\ =\ *myWindow*: - 804 Finds the window using its internal JavaScript "name" property. This is the second - 805 parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) - 806 (which Selenium intercepts). - 807 - 808 * \ **var**\ =\ *variableName*: - 809 Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current - 810 application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using - 811 "var=foo". - 812 - 813 - 814 - 815 - 816 If no window locator prefix is provided, we'll try to guess what you mean like this: - 817 - 818 1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser). - 819 - 820 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed - 821 that this variable contains the return value from a call to the JavaScript window.open() method. - 822 - 823 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names". - 824 - 825 4.) If \ *that* fails, we'll try looping over all of the known windows to try to find the appropriate "title". - 826 Since "title" is not necessarily unique, this may have unexpected behavior. - 827 - 828 If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages - 829 which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages - 830 like the following for each window as it is opened: - 831 - 832 ``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"`` - 833 - 834 In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - 835 (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - 836 an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - 837 - 838 - 839 'windowID' is the JavaScript window ID of the window to select - 840 """ - 841 self.do_command("selectWindow", [windowID,]) -
842 - 843 -
844 - def select_pop_up(self,windowID): -
845 """ - 846 Simplifies the process of selecting a popup window (and does not offer - 847 functionality beyond what ``selectWindow()`` already provides). - 848 - 849 * If ``windowID`` is either not specified, or specified as - 850 "null", the first non-top window is selected. The top window is the one - 851 that would be selected by ``selectWindow()`` without providing a - 852 ``windowID`` . This should not be used when more than one popup - 853 window is in play. - 854 * Otherwise, the window will be looked up considering - 855 ``windowID`` as the following in order: 1) the "name" of the - 856 window, as specified to ``window.open()``; 2) a javascript - 857 variable which is a reference to a window; and 3) the title of the - 858 window. This is the same ordered lookup performed by - 859 ``selectWindow`` . - 860 - 861 - 862 - 863 'windowID' is an identifier for the popup window, which can take on a number of different meanings - 864 """ - 865 self.do_command("selectPopUp", [windowID,]) -
866 - 867 -
868 - def deselect_pop_up(self): -
869 """ - 870 Selects the main window. Functionally equivalent to using - 871 ``selectWindow()`` and specifying no value for - 872 ``windowID``. - 873 - 874 """ - 875 self.do_command("deselectPopUp", []) -
876 - 877 -
878 - def select_frame(self,locator): -
879 """ - 880 Selects a frame within the current window. (You may invoke this command - 881 multiple times to select nested frames.) To select the parent frame, use - 882 "relative=parent" as a locator; to select the top frame, use "relative=top". - 883 You can also select a frame by its 0-based index number; select the first frame with - 884 "index=0", or the third frame with "index=2". - 885 - 886 - 887 You may also use a DOM expression to identify the frame you want directly, - 888 like this: ``dom=frames["main"].frames["subframe"]`` - 889 - 890 - 891 'locator' is an element locator identifying a frame or iframe - 892 """ - 893 self.do_command("selectFrame", [locator,]) -
894 - 895 -
896 - def get_whether_this_frame_match_frame_expression(self,currentFrameString,target): -
897 """ - 898 Determine whether current/locator identify the frame containing this running code. - 899 - 900 - 901 This is useful in proxy injection mode, where this code runs in every - 902 browser frame and window, and sometimes the selenium server needs to identify - 903 the "current" frame. In this case, when the test calls selectFrame, this - 904 routine is called for each frame to figure out which one has been selected. - 905 The selected frame will return true, while all others will return false. - 906 - 907 - 908 'currentFrameString' is starting frame - 909 'target' is new frame (which might be relative to the current one) - 910 """ - 911 return self.get_boolean("getWhetherThisFrameMatchFrameExpression", [currentFrameString,target,]) -
912 - 913 -
914 - def get_whether_this_window_match_window_expression(self,currentWindowString,target): -
915 """ - 916 Determine whether currentWindowString plus target identify the window containing this running code. - 917 - 918 - 919 This is useful in proxy injection mode, where this code runs in every - 920 browser frame and window, and sometimes the selenium server needs to identify - 921 the "current" window. In this case, when the test calls selectWindow, this - 922 routine is called for each window to figure out which one has been selected. - 923 The selected window will return true, while all others will return false. - 924 - 925 - 926 'currentWindowString' is starting window - 927 'target' is new window (which might be relative to the current one, e.g., "_parent") - 928 """ - 929 return self.get_boolean("getWhetherThisWindowMatchWindowExpression", [currentWindowString,target,]) -
930 - 931 -
932 - def wait_for_pop_up(self,windowID,timeout): -
933 """ - 934 Waits for a popup window to appear and load up. - 935 - 936 'windowID' is the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously). - 937 'timeout' is a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command. - 938 """ - 939 self.do_command("waitForPopUp", [windowID,timeout,]) -
940 - 941 -
943 """ - 944 - 945 - 946 By default, Selenium's overridden window.confirm() function will - 947 return true, as if the user had manually clicked OK; after running - 948 this command, the next call to confirm() will return false, as if - 949 the user had clicked Cancel. Selenium will then resume using the - 950 default behavior for future confirmations, automatically returning - 951 true (OK) unless/until you explicitly call this command for each - 952 confirmation. - 953 - 954 - 955 - 956 Take note - every time a confirmation comes up, you must - 957 consume it with a corresponding getConfirmation, or else - 958 the next selenium operation will fail. - 959 - 960 - 961 - 962 """ - 963 self.do_command("chooseCancelOnNextConfirmation", []) -
964 - 965 -
967 """ - 968 - 969 - 970 Undo the effect of calling chooseCancelOnNextConfirmation. Note - 971 that Selenium's overridden window.confirm() function will normally automatically - 972 return true, as if the user had manually clicked OK, so you shouldn't - 973 need to use this command unless for some reason you need to change - 974 your mind prior to the next confirmation. After any confirmation, Selenium will resume using the - 975 default behavior for future confirmations, automatically returning - 976 true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each - 977 confirmation. - 978 - 979 - 980 - 981 Take note - every time a confirmation comes up, you must - 982 consume it with a corresponding getConfirmation, or else - 983 the next selenium operation will fail. - 984 - 985 - 986 - 987 """ - 988 self.do_command("chooseOkOnNextConfirmation", []) -
989 - 990 -
991 - def answer_on_next_prompt(self,answer): -
992 """ - 993 Instructs Selenium to return the specified answer string in response to - 994 the next JavaScript prompt [window.prompt()]. - 995 - 996 'answer' is the answer to give in response to the prompt pop-up - 997 """ - 998 self.do_command("answerOnNextPrompt", [answer,]) -
999 -1000 -
1001 - def go_back(self): -
1002 """ -1003 Simulates the user clicking the "back" button on their browser. -1004 -1005 """ -1006 self.do_command("goBack", []) -
1007 -1008 -
1009 - def refresh(self): -
1010 """ -1011 Simulates the user clicking the "Refresh" button on their browser. -1012 -1013 """ -1014 self.do_command("refresh", []) -
1015 -1016 -
1017 - def close(self): -
1018 """ -1019 Simulates the user clicking the "close" button in the titlebar of a popup -1020 window or tab. -1021 -1022 """ -1023 self.do_command("close", []) -
1024 -1025 -
1026 - def is_alert_present(self): -
1027 """ -1028 Has an alert occurred? -1029 -1030 -1031 -1032 This function never throws an exception -1033 -1034 -1035 -1036 """ -1037 return self.get_boolean("isAlertPresent", []) -
1038 -1039 -
1040 - def is_prompt_present(self): -
1041 """ -1042 Has a prompt occurred? -1043 -1044 -1045 -1046 This function never throws an exception -1047 -1048 -1049 -1050 """ -1051 return self.get_boolean("isPromptPresent", []) -
1052 -1053 -
1054 - def is_confirmation_present(self): -
1055 """ -1056 Has confirm() been called? -1057 -1058 -1059 -1060 This function never throws an exception -1061 -1062 -1063 -1064 """ -1065 return self.get_boolean("isConfirmationPresent", []) -
1066 -1067 -
1068 - def get_alert(self): -
1069 """ -1070 Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. -1071 -1072 -1073 Getting an alert has the same effect as manually clicking OK. If an -1074 alert is generated but you do not consume it with getAlert, the next Selenium action -1075 will fail. -1076 -1077 Under Selenium, JavaScript alerts will NOT pop up a visible alert -1078 dialog. -1079 -1080 Selenium does NOT support JavaScript alerts that are generated in a -1081 page's onload() event handler. In this case a visible dialog WILL be -1082 generated and Selenium will hang until someone manually clicks OK. -1083 -1084 -1085 """ -1086 return self.get_string("getAlert", []) -
1087 -1088 -
1089 - def get_confirmation(self): -
1090 """ -1091 Retrieves the message of a JavaScript confirmation dialog generated during -1092 the previous action. -1093 -1094 -1095 -1096 By default, the confirm function will return true, having the same effect -1097 as manually clicking OK. This can be changed by prior execution of the -1098 chooseCancelOnNextConfirmation command. -1099 -1100 -1101 -1102 If an confirmation is generated but you do not consume it with getConfirmation, -1103 the next Selenium action will fail. -1104 -1105 -1106 -1107 NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible -1108 dialog. -1109 -1110 -1111 -1112 NOTE: Selenium does NOT support JavaScript confirmations that are -1113 generated in a page's onload() event handler. In this case a visible -1114 dialog WILL be generated and Selenium will hang until you manually click -1115 OK. -1116 -1117 -1118 -1119 """ -1120 return self.get_string("getConfirmation", []) -
1121 -1122 -
1123 - def get_prompt(self): -
1124 """ -1125 Retrieves the message of a JavaScript question prompt dialog generated during -1126 the previous action. -1127 -1128 -1129 Successful handling of the prompt requires prior execution of the -1130 answerOnNextPrompt command. If a prompt is generated but you -1131 do not get/verify it, the next Selenium action will fail. -1132 -1133 NOTE: under Selenium, JavaScript prompts will NOT pop up a visible -1134 dialog. -1135 -1136 NOTE: Selenium does NOT support JavaScript prompts that are generated in a -1137 page's onload() event handler. In this case a visible dialog WILL be -1138 generated and Selenium will hang until someone manually clicks OK. -1139 -1140 -1141 """ -1142 return self.get_string("getPrompt", []) -
1143 -1144 -
1145 - def get_location(self): -
1146 """ -1147 Gets the absolute URL of the current page. -1148 -1149 """ -1150 return self.get_string("getLocation", []) -
1151 -1152 -
1153 - def get_title(self): -
1154 """ -1155 Gets the title of the current page. -1156 -1157 """ -1158 return self.get_string("getTitle", []) -
1159 -1160 -
1161 - def get_body_text(self): -
1162 """ -1163 Gets the entire text of the page. -1164 -1165 """ -1166 return self.get_string("getBodyText", []) -
1167 -1168 -
1169 - def get_value(self,locator): -
1170 """ -1171 Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). -1172 For checkbox/radio elements, the value will be "on" or "off" depending on -1173 whether the element is checked or not. -1174 -1175 'locator' is an element locator -1176 """ -1177 return self.get_string("getValue", [locator,]) -
1178 -1179 -
1180 - def get_text(self,locator): -
1181 """ -1182 Gets the text of an element. This works for any element that contains -1183 text. This command uses either the textContent (Mozilla-like browsers) or -1184 the innerText (IE-like browsers) of the element, which is the rendered -1185 text shown to the user. -1186 -1187 'locator' is an element locator -1188 """ -1189 return self.get_string("getText", [locator,]) -
1190 -1191 -
1192 - def highlight(self,locator): -
1193 """ -1194 Briefly changes the backgroundColor of the specified element yellow. Useful for debugging. -1195 -1196 'locator' is an element locator -1197 """ -1198 self.do_command("highlight", [locator,]) -
1199 -1200 -
1201 - def get_eval(self,script): -
1202 """ -1203 Gets the result of evaluating the specified JavaScript snippet. The snippet may -1204 have multiple lines, but only the result of the last line will be returned. -1205 -1206 -1207 Note that, by default, the snippet will run in the context of the "selenium" -1208 object itself, so ``this`` will refer to the Selenium object. Use ``window`` to -1209 refer to the window of your application, e.g. ``window.document.getElementById('foo')`` -1210 -1211 If you need to use -1212 a locator to refer to a single element in your application page, you can -1213 use ``this.browserbot.findElement("id=foo")`` where "id=foo" is your locator. -1214 -1215 -1216 'script' is the JavaScript snippet to run -1217 """ -1218 return self.get_string("getEval", [script,]) -
1219 -1220 -
1221 - def is_checked(self,locator): -
1222 """ -1223 Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button. -1224 -1225 'locator' is an element locator pointing to a checkbox or radio button -1226 """ -1227 return self.get_boolean("isChecked", [locator,]) -
1228 -1229 -
1230 - def get_table(self,tableCellAddress): -
1231 """ -1232 Gets the text from a cell of a table. The cellAddress syntax -1233 tableLocator.row.column, where row and column start at 0. -1234 -1235 'tableCellAddress' is a cell address, e.g. "foo.1.4" -1236 """ -1237 return self.get_string("getTable", [tableCellAddress,]) -
1238 -1239 -
1240 - def get_selected_labels(self,selectLocator): -
1241 """ -1242 Gets all option labels (visible text) for selected options in the specified select or multi-select element. -1243 -1244 'selectLocator' is an element locator identifying a drop-down menu -1245 """ -1246 return self.get_string_array("getSelectedLabels", [selectLocator,]) -
1247 -1248 -
1249 - def get_selected_label(self,selectLocator): -
1250 """ -1251 Gets option label (visible text) for selected option in the specified select element. -1252 -1253 'selectLocator' is an element locator identifying a drop-down menu -1254 """ -1255 return self.get_string("getSelectedLabel", [selectLocator,]) -
1256 -1257 -
1258 - def get_selected_values(self,selectLocator): -
1259 """ -1260 Gets all option values (value attributes) for selected options in the specified select or multi-select element. -1261 -1262 'selectLocator' is an element locator identifying a drop-down menu -1263 """ -1264 return self.get_string_array("getSelectedValues", [selectLocator,]) -
1265 -1266 -
1267 - def get_selected_value(self,selectLocator): -
1268 """ -1269 Gets option value (value attribute) for selected option in the specified select element. -1270 -1271 'selectLocator' is an element locator identifying a drop-down menu -1272 """ -1273 return self.get_string("getSelectedValue", [selectLocator,]) -
1274 -1275 -
1276 - def get_selected_indexes(self,selectLocator): -
1277 """ -1278 Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. -1279 -1280 'selectLocator' is an element locator identifying a drop-down menu -1281 """ -1282 return self.get_string_array("getSelectedIndexes", [selectLocator,]) -
1283 -1284 -
1285 - def get_selected_index(self,selectLocator): -
1286 """ -1287 Gets option index (option number, starting at 0) for selected option in the specified select element. -1288 -1289 'selectLocator' is an element locator identifying a drop-down menu -1290 """ -1291 return self.get_string("getSelectedIndex", [selectLocator,]) -
1292 -1293 -
1294 - def get_selected_ids(self,selectLocator): -
1295 """ -1296 Gets all option element IDs for selected options in the specified select or multi-select element. -1297 -1298 'selectLocator' is an element locator identifying a drop-down menu -1299 """ -1300 return self.get_string_array("getSelectedIds", [selectLocator,]) -
1301 -1302 -
1303 - def get_selected_id(self,selectLocator): -
1304 """ -1305 Gets option element ID for selected option in the specified select element. -1306 -1307 'selectLocator' is an element locator identifying a drop-down menu -1308 """ -1309 return self.get_string("getSelectedId", [selectLocator,]) -
1310 -1311 -
1312 - def is_something_selected(self,selectLocator): -
1313 """ -1314 Determines whether some option in a drop-down menu is selected. -1315 -1316 'selectLocator' is an element locator identifying a drop-down menu -1317 """ -1318 return self.get_boolean("isSomethingSelected", [selectLocator,]) -
1319 -1320 -
1321 - def get_select_options(self,selectLocator): -
1322 """ -1323 Gets all option labels in the specified select drop-down. -1324 -1325 'selectLocator' is an element locator identifying a drop-down menu -1326 """ -1327 return self.get_string_array("getSelectOptions", [selectLocator,]) -
1328 -1329 -
1330 - def get_attribute(self,attributeLocator): -
1331 """ -1332 Gets the value of an element attribute. The value of the attribute may -1333 differ across browsers (this is the case for the "style" attribute, for -1334 example). -1335 -1336 'attributeLocator' is an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar" -1337 """ -1338 return self.get_string("getAttribute", [attributeLocator,]) -
1339 -1340 -
1341 - def is_text_present(self,pattern): -
1342 """ -1343 Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. -1344 -1345 'pattern' is a pattern to match with the text of the page -1346 """ -1347 return self.get_boolean("isTextPresent", [pattern,]) -
1348 -1349 -
1350 - def is_element_present(self,locator): -
1351 """ -1352 Verifies that the specified element is somewhere on the page. -1353 -1354 'locator' is an element locator -1355 """ -1356 return self.get_boolean("isElementPresent", [locator,]) -
1357 -1358 -
1359 - def is_visible(self,locator): -
1360 """ -1361 Determines if the specified element is visible. An -1362 element can be rendered invisible by setting the CSS "visibility" -1363 property to "hidden", or the "display" property to "none", either for the -1364 element itself or one if its ancestors. This method will fail if -1365 the element is not present. -1366 -1367 'locator' is an element locator -1368 """ -1369 return self.get_boolean("isVisible", [locator,]) -
1370 -1371 -
1372 - def is_editable(self,locator): -
1373 """ -1374 Determines whether the specified input element is editable, ie hasn't been disabled. -1375 This method will fail if the specified element isn't an input element. -1376 -1377 'locator' is an element locator -1378 """ -1379 return self.get_boolean("isEditable", [locator,]) -
1380 -1381 -
1382 - def get_all_buttons(self): -
1383 """ -1384 Returns the IDs of all buttons on the page. -1385 -1386 -1387 If a given button has no ID, it will appear as "" in this array. -1388 -1389 -1390 """ -1391 return self.get_string_array("getAllButtons", []) -
1392 -1393 -1404 -1405 -
1406 - def get_all_fields(self): -
1407 """ -1408 Returns the IDs of all input fields on the page. -1409 -1410 -1411 If a given field has no ID, it will appear as "" in this array. -1412 -1413 -1414 """ -1415 return self.get_string_array("getAllFields", []) -
1416 -1417 -
1418 - def get_attribute_from_all_windows(self,attributeName): -
1419 """ -1420 Returns every instance of some attribute from all known windows. -1421 -1422 'attributeName' is name of an attribute on the windows -1423 """ -1424 return self.get_string_array("getAttributeFromAllWindows", [attributeName,]) -
1425 -1426 -
1427 - def dragdrop(self,locator,movementsString): -
1428 """ -1429 deprecated - use dragAndDrop instead -1430 -1431 'locator' is an element locator -1432 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" -1433 """ -1434 self.do_command("dragdrop", [locator,movementsString,]) -
1435 -1436 -
1437 - def set_mouse_speed(self,pixels): -
1438 """ -1439 Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). -1440 -1441 Setting this value to 0 means that we'll send a "mousemove" event to every single pixel -1442 in between the start location and the end location; that can be very slow, and may -1443 cause some browsers to force the JavaScript to timeout. -1444 -1445 If the mouse speed is greater than the distance between the two dragged objects, we'll -1446 just send one "mousemove" at the start location and then one final one at the end location. -1447 -1448 -1449 'pixels' is the number of pixels between "mousemove" events -1450 """ -1451 self.do_command("setMouseSpeed", [pixels,]) -
1452 -1453 -
1454 - def get_mouse_speed(self): -
1455 """ -1456 Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). -1457 -1458 """ -1459 return self.get_number("getMouseSpeed", []) -
1460 -1461 -
1462 - def drag_and_drop(self,locator,movementsString): -
1463 """ -1464 Drags an element a certain distance and then drops it -1465 -1466 'locator' is an element locator -1467 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" -1468 """ -1469 self.do_command("dragAndDrop", [locator,movementsString,]) -
1470 -1471 -
1472 - def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject): -
1473 """ -1474 Drags an element and drops it on another element -1475 -1476 'locatorOfObjectToBeDragged' is an element to be dragged -1477 'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped -1478 """ -1479 self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,]) -
1480 -1481 -
1482 - def window_focus(self): -
1483 """ -1484 Gives focus to the currently selected window -1485 -1486 """ -1487 self.do_command("windowFocus", []) -
1488 -1489 -
1490 - def window_maximize(self): -
1491 """ -1492 Resize currently selected window to take up the entire screen -1493 -1494 """ -1495 self.do_command("windowMaximize", []) -
1496 -1497 -
1498 - def get_all_window_ids(self): -
1499 """ -1500 Returns the IDs of all windows that the browser knows about. -1501 -1502 """ -1503 return self.get_string_array("getAllWindowIds", []) -
1504 -1505 -
1506 - def get_all_window_names(self): -
1507 """ -1508 Returns the names of all windows that the browser knows about. -1509 -1510 """ -1511 return self.get_string_array("getAllWindowNames", []) -
1512 -1513 -
1514 - def get_all_window_titles(self): -
1515 """ -1516 Returns the titles of all windows that the browser knows about. -1517 -1518 """ -1519 return self.get_string_array("getAllWindowTitles", []) -
1520 -1521 -
1522 - def get_html_source(self): -
1523 """ -1524 Returns the entire HTML source between the opening and -1525 closing "html" tags. -1526 -1527 """ -1528 return self.get_string("getHtmlSource", []) -
1529 -1530 -
1531 - def set_cursor_position(self,locator,position): -
1532 """ -1533 Moves the text cursor to the specified position in the given input element or textarea. -1534 This method will fail if the specified element isn't an input element or textarea. -1535 -1536 'locator' is an element locator pointing to an input element or textarea -1537 'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field. -1538 """ -1539 self.do_command("setCursorPosition", [locator,position,]) -
1540 -1541 -
1542 - def get_element_index(self,locator): -
1543 """ -1544 Get the relative index of an element to its parent (starting from 0). The comment node and empty text node -1545 will be ignored. -1546 -1547 'locator' is an element locator pointing to an element -1548 """ -1549 return self.get_number("getElementIndex", [locator,]) -
1550 -1551 -
1552 - def is_ordered(self,locator1,locator2): -
1553 """ -1554 Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will -1555 not be considered ordered. -1556 -1557 'locator1' is an element locator pointing to the first element -1558 'locator2' is an element locator pointing to the second element -1559 """ -1560 return self.get_boolean("isOrdered", [locator1,locator2,]) -
1561 -1562 -
1563 - def get_element_position_left(self,locator): -
1564 """ -1565 Retrieves the horizontal position of an element -1566 -1567 'locator' is an element locator pointing to an element OR an element itself -1568 """ -1569 return self.get_number("getElementPositionLeft", [locator,]) -
1570 -1571 -
1572 - def get_element_position_top(self,locator): -
1573 """ -1574 Retrieves the vertical position of an element -1575 -1576 'locator' is an element locator pointing to an element OR an element itself -1577 """ -1578 return self.get_number("getElementPositionTop", [locator,]) -
1579 -1580 -
1581 - def get_element_width(self,locator): -
1582 """ -1583 Retrieves the width of an element -1584 -1585 'locator' is an element locator pointing to an element -1586 """ -1587 return self.get_number("getElementWidth", [locator,]) -
1588 -1589 -
1590 - def get_element_height(self,locator): -
1591 """ -1592 Retrieves the height of an element -1593 -1594 'locator' is an element locator pointing to an element -1595 """ -1596 return self.get_number("getElementHeight", [locator,]) -
1597 -1598 -
1599 - def get_cursor_position(self,locator): -
1600 """ -1601 Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. -1602 -1603 -1604 Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to -1605 return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243. -1606 -1607 This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element. -1608 -1609 'locator' is an element locator pointing to an input element or textarea -1610 """ -1611 return self.get_number("getCursorPosition", [locator,]) -
1612 -1613 -
1614 - def get_expression(self,expression): -
1615 """ -1616 Returns the specified expression. -1617 -1618 -1619 This is useful because of JavaScript preprocessing. -1620 It is used to generate commands like assertExpression and waitForExpression. -1621 -1622 -1623 'expression' is the value to return -1624 """ -1625 return self.get_string("getExpression", [expression,]) -
1626 -1627 -
1628 - def get_xpath_count(self,xpath): -
1629 """ -1630 Returns the number of nodes that match the specified xpath, eg. "//table" would give -1631 the number of tables. -1632 -1633 'xpath' is the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you. -1634 """ -1635 return self.get_number("getXpathCount", [xpath,]) -
1636 -1637 -
1638 - def assign_id(self,locator,identifier): -
1639 """ -1640 Temporarily sets the "id" attribute of the specified element, so you can locate it in the future -1641 using its ID rather than a slow/complicated XPath. This ID will disappear once the page is -1642 reloaded. -1643 -1644 'locator' is an element locator pointing to an element -1645 'identifier' is a string to be used as the ID of the specified element -1646 """ -1647 self.do_command("assignId", [locator,identifier,]) -
1648 -1649 -
1650 - def allow_native_xpath(self,allow): -
1651 """ -1652 Specifies whether Selenium should use the native in-browser implementation -1653 of XPath (if any native version is available); if you pass "false" to -1654 this function, we will always use our pure-JavaScript xpath library. -1655 Using the pure-JS xpath library can improve the consistency of xpath -1656 element locators between different browser vendors, but the pure-JS -1657 version is much slower than the native implementations. -1658 -1659 'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath -1660 """ -1661 self.do_command("allowNativeXpath", [allow,]) -
1662 -1663 -
1664 - def ignore_attributes_without_value(self,ignore): -
1665 """ -1666 Specifies whether Selenium will ignore xpath attributes that have no -1667 value, i.e. are the empty string, when using the non-native xpath -1668 evaluation engine. You'd want to do this for performance reasons in IE. -1669 However, this could break certain xpaths, for example an xpath that looks -1670 for an attribute whose value is NOT the empty string. -1671 -1672 The hope is that such xpaths are relatively rare, but the user should -1673 have the option of using them. Note that this only influences xpath -1674 evaluation when using the ajaxslt engine (i.e. not "javascript-xpath"). -1675 -1676 'ignore' is boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness. -1677 """ -1678 self.do_command("ignoreAttributesWithoutValue", [ignore,]) -
1679 -1680 -
1681 - def wait_for_condition(self,script,timeout): -
1682 """ -1683 Runs the specified JavaScript snippet repeatedly until it evaluates to "true". -1684 The snippet may have multiple lines, but only the result of the last line -1685 will be considered. -1686 -1687 -1688 Note that, by default, the snippet will be run in the runner's test window, not in the window -1689 of your application. To get the window of your application, you can use -1690 the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then -1691 run your JavaScript in there -1692 -1693 -1694 'script' is the JavaScript snippet to run -1695 'timeout' is a timeout in milliseconds, after which this command will return with an error -1696 """ -1697 self.do_command("waitForCondition", [script,timeout,]) -
1698 -1699 -
1700 - def set_timeout(self,timeout): -
1701 """ -1702 Specifies the amount of time that Selenium will wait for actions to complete. -1703 -1704 -1705 Actions that require waiting include "open" and the "waitFor\*" actions. -1706 -1707 The default timeout is 30 seconds. -1708 -1709 'timeout' is a timeout in milliseconds, after which the action will return with an error -1710 """ -1711 self.do_command("setTimeout", [timeout,]) -
1712 -1713 -
1714 - def wait_for_page_to_load(self,timeout): -
1715 """ -1716 Waits for a new page to load. -1717 -1718 -1719 You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. -1720 (which are only available in the JS API). -1721 -1722 Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" -1723 flag when it first notices a page load. Running any other Selenium command after -1724 turns the flag to false. Hence, if you want to wait for a page to load, you must -1725 wait immediately after a Selenium command that caused a page-load. -1726 -1727 -1728 'timeout' is a timeout in milliseconds, after which this command will return with an error -1729 """ -1730 self.do_command("waitForPageToLoad", [timeout,]) -
1731 -1732 -
1733 - def wait_for_frame_to_load(self,frameAddress,timeout): -
1734 """ -1735 Waits for a new frame to load. -1736 -1737 -1738 Selenium constantly keeps track of new pages and frames loading, -1739 and sets a "newPageLoaded" flag when it first notices a page load. -1740 -1741 -1742 See waitForPageToLoad for more information. -1743 -1744 'frameAddress' is FrameAddress from the server side -1745 'timeout' is a timeout in milliseconds, after which this command will return with an error -1746 """ -1747 self.do_command("waitForFrameToLoad", [frameAddress,timeout,]) -
1748 -1749 -1756 -1757 -1765 -1766 -1774 -1775 -1785 -1786 -1804 -1805 -
1806 - def delete_all_visible_cookies(self): -
1807 """ -1808 Calls deleteCookie with recurse=true on all cookies visible to the current page. -1809 As noted on the documentation for deleteCookie, recurse=true can be much slower -1810 than simply deleting the cookies using a known domain/path. -1811 -1812 """ -1813 self.do_command("deleteAllVisibleCookies", []) -
1814 -1815 -
1816 - def set_browser_log_level(self,logLevel): -
1817 """ -1818 Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. -1819 Valid logLevel strings are: "debug", "info", "warn", "error" or "off". -1820 To see the browser logs, you need to -1821 either show the log window in GUI mode, or enable browser-side logging in Selenium RC. -1822 -1823 'logLevel' is one of the following: "debug", "info", "warn", "error" or "off" -1824 """ -1825 self.do_command("setBrowserLogLevel", [logLevel,]) -
1826 -1827 -
1828 - def run_script(self,script): -
1829 """ -1830 Creates a new "script" tag in the body of the current test window, and -1831 adds the specified text into the body of the command. Scripts run in -1832 this way can often be debugged more easily than scripts executed using -1833 Selenium's "getEval" command. Beware that JS exceptions thrown in these script -1834 tags aren't managed by Selenium, so you should probably wrap your script -1835 in try/catch blocks if there is any chance that the script will throw -1836 an exception. -1837 -1838 'script' is the JavaScript snippet to run -1839 """ -1840 self.do_command("runScript", [script,]) -
1841 -1842 -
1843 - def add_location_strategy(self,strategyName,functionDefinition): -
1844 """ -1845 Defines a new function for Selenium to locate elements on the page. -1846 For example, -1847 if you define the strategy "foo", and someone runs click("foo=blah"), we'll -1848 run your function, passing you the string "blah", and click on the element -1849 that your function -1850 returns, or throw an "Element not found" error if your function returns null. -1851 -1852 We'll pass three arguments to your function: -1853 -1854 * locator: the string the user passed in -1855 * inWindow: the currently selected window -1856 * inDocument: the currently selected document -1857 -1858 -1859 The function must return null if the element can't be found. -1860 -1861 'strategyName' is the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation. -1862 'functionDefinition' is a string defining the body of a function in JavaScript. For example: ``return inDocument.getElementById(locator);`` -1863 """ -1864 self.do_command("addLocationStrategy", [strategyName,functionDefinition,]) -
1865 -1866 -
1867 - def capture_entire_page_screenshot(self,filename,kwargs): -
1868 """ -1869 Saves the entire contents of the current window canvas to a PNG file. -1870 Contrast this with the captureScreenshot command, which captures the -1871 contents of the OS viewport (i.e. whatever is currently being displayed -1872 on the monitor), and is implemented in the RC only. Currently this only -1873 works in Firefox when running in chrome mode, and in IE non-HTA using -1874 the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly -1875 borrowed from the Screengrab! Firefox extension. Please see -1876 http://www.screengrab.org and http://snapsie.sourceforge.net/ for -1877 details. -1878 -1879 'filename' is the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code. -1880 'kwargs' is a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: -1881 * background -1882 the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). -1883 -1884 -1885 """ -1886 self.do_command("captureEntirePageScreenshot", [filename,kwargs,]) -
1887 -1888 -
1889 - def rollup(self,rollupName,kwargs): -
1890 """ -1891 Executes a command rollup, which is a series of commands with a unique -1892 name, and optionally arguments that control the generation of the set of -1893 commands. If any one of the rolled-up commands fails, the rollup is -1894 considered to have failed. Rollups may also contain nested rollups. -1895 -1896 'rollupName' is the name of the rollup command -1897 'kwargs' is keyword arguments string that influences how the rollup expands into commands -1898 """ -1899 self.do_command("rollup", [rollupName,kwargs,]) -
1900 -1901 -
1902 - def add_script(self,scriptContent,scriptTagId): -
1903 """ -1904 Loads script content into a new script tag in the Selenium document. This -1905 differs from the runScript command in that runScript adds the script tag -1906 to the document of the AUT, not the Selenium document. The following -1907 entities in the script content are replaced by the characters they -1908 represent: -1909 -1910 &lt; -1911 &gt; -1912 &amp; -1913 -1914 The corresponding remove command is removeScript. -1915 -1916 'scriptContent' is the Javascript content of the script to add -1917 'scriptTagId' is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail. -1918 """ -1919 self.do_command("addScript", [scriptContent,scriptTagId,]) -
1920 -1921 -
1922 - def remove_script(self,scriptTagId): -
1923 """ -1924 Removes a script tag from the Selenium document identified by the given -1925 id. Does nothing if the referenced tag doesn't exist. -1926 -1927 'scriptTagId' is the id of the script element to remove. -1928 """ -1929 self.do_command("removeScript", [scriptTagId,]) -
1930 -1931 -
1932 - def use_xpath_library(self,libraryName): -
1933 """ -1934 Allows choice of one of the available libraries. -1935 -1936 'libraryName' is name of the desired library Only the following three can be chosen: -1937 * "ajaxslt" - Google's library -1938 * "javascript-xpath" - Cybozu Labs' faster library -1939 * "default" - The default library. Currently the default library is "ajaxslt" . -1940 -1941 If libraryName isn't one of these three, then no change will be made. -1942 """ -1943 self.do_command("useXpathLibrary", [libraryName,]) -
1944 -1945 -
1946 - def set_context(self,context): -
1947 """ -1948 Writes a message to the status bar and adds a note to the browser-side -1949 log. -1950 -1951 'context' is the message to be sent to the browser -1952 """ -1953 self.do_command("setContext", [context,]) -
1954 -1955 -
1956 - def attach_file(self,fieldLocator,fileLocator): -
1957 """ -1958 Sets a file input (upload) field to the file listed in fileLocator -1959 -1960 'fieldLocator' is an element locator -1961 'fileLocator' is a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("\*chrome") only. -1962 """ -1963 self.do_command("attachFile", [fieldLocator,fileLocator,]) -
1964 -1965 -
1966 - def capture_screenshot(self,filename): -
1967 """ -1968 Captures a PNG screenshot to the specified file. -1969 -1970 'filename' is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png" -1971 """ -1972 self.do_command("captureScreenshot", [filename,]) -
1973 -1974 -
1976 """ -1977 Capture a PNG screenshot. It then returns the file as a base 64 encoded string. -1978 -1979 """ -1980 return self.get_string("captureScreenshotToString", []) -
1981 -1982 -
1983 - def captureNetworkTraffic(self, type): -
1984 """ -1985 Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. When this function is called, the traffic log is cleared, so the returned content is only the traffic seen since the last call. -1986 -1987 'type' is The type of data to return the network traffic as. Valid values are: json, xml, or plain. -1988 """ -1989 return self.get_string("captureNetworkTraffic", [type,]) -
1990 -
1991 - def addCustomRequestHeader(self, key, value): -
1992 """ -1993 Tells the Selenium server to add the specificed key and value as a custom outgoing request header. This only works if the browser is configured to use the built in Selenium proxy. -1994 -1995 'key' the header name. -1996 'value' the header value. -1997 """ -1998 return self.do_command("addCustomRequestHeader", [key,value,]) -
1999 -
2001 """ -2002 Downloads a screenshot of the browser current window canvas to a -2003 based 64 encoded PNG file. The \ *entire* windows canvas is captured, -2004 including parts rendered outside of the current view port. -2005 -2006 Currently this only works in Mozilla and when running in chrome mode. -2007 -2008 'kwargs' is A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). -2009 """ -2010 return self.get_string("captureEntirePageScreenshotToString", [kwargs,]) -
2011 -2012 -
2013 - def shut_down_selenium_server(self): -
2014 """ -2015 Kills the running Selenium Server and all browser sessions. After you run this command, you will no longer be able to send -2016 commands to the server; you can't remotely start the server once it has been stopped. Normally -2017 you should prefer to run the "stop" command, which terminates the current browser session, rather than -2018 shutting down the entire server. -2019 -2020 """ -2021 self.do_command("shutDownSeleniumServer", []) -
2022 -2023 -
2025 """ -2026 Retrieve the last messages logged on a specific remote control. Useful for error reports, especially -2027 when running multiple remote controls in a distributed environment. The maximum number of log messages -2028 that can be retrieve is configured on remote control startup. -2029 -2030 """ -2031 return self.get_string("retrieveLastRemoteControlLogs", []) -
2032 -2033 -
2034 - def key_down_native(self,keycode): -
2035 """ -2036 Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. -2037 This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -2038 a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -2039 metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -2040 element, focus on the element first before running this command. -2041 -2042 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! -2043 """ -2044 self.do_command("keyDownNative", [keycode,]) -
2045 -2046 -
2047 - def key_up_native(self,keycode): -
2048 """ -2049 Simulates a user releasing a key by sending a native operating system keystroke. -2050 This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -2051 a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -2052 metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -2053 element, focus on the element first before running this command. -2054 -2055 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! -2056 """ -2057 self.do_command("keyUpNative", [keycode,]) -
2058 -2059 -
2060 - def key_press_native(self,keycode): -
2061 """ -2062 Simulates a user pressing and releasing a key by sending a native operating system keystroke. -2063 This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -2064 a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -2065 metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -2066 element, focus on the element first before running this command. -2067 -2068 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! -2069 """ -2070 self.do_command("keyPressNative", [keycode,]) -
2071 -
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium.selenium-class.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium.selenium-class.html deleted file mode 100644 index 6b4a720cb7..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/selenium.selenium-class.html +++ /dev/null @@ -1,5174 +0,0 @@ - - - - - selenium.selenium - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Module selenium :: - Class selenium - - - - - - -
[hide private]
[frames] | no frames]
-
- -

Class selenium -
source code

-

Defines an object that runs Selenium commands.

-
-

Element Locators

-

Element Locators tell Selenium which HTML element a command refers to. -The format of a locator is:

-

locatorType=argument

-

We support the following strategies for locating elements:

-
    -
  • identifier=id: -Select the element with the specified @id attribute. If no match is -found, select the first element whose @name attribute is id. -(This is normally the default; see below.)

    -
  • -
  • id=id: -Select the element with the specified @id attribute.

    -
  • -
  • name=name: -Select the first element with the specified @name attribute.

    -
      -
    • username
    • -
    • name=username
    • -
    -

    The name may optionally be followed by one or more element-filters, separated from the name by whitespace. If the filterType is not specified, value is assumed.

    -
      -
    • name=flavour value=chocolate
    • -
    -
  • -
  • dom=javascriptExpression:

    -

    Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object -Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block.

    -
      -
    • dom=document.forms['myForm'].myDropdown
    • -
    • dom=document.images[56]
    • -
    • dom=function foo() { return document.links[1]; }; foo();
    • -
    -
  • -
  • xpath=xpathExpression: -Locate an element using an XPath expression.

    -
      -
    • xpath=//img[@alt='The image alt text']
    • -
    • xpath=//table[@id='table1']//tr[4]/td[2]
    • -
    • xpath=//a[contains(@href,'#id1')]
    • -
    • xpath=//a[contains(@href,'#id1')]/@class
    • -
    • xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td
    • -
    • xpath=//input[@name='name2' and @value='yes']
    • -
    • xpath=//*[text()="right"]
    • -
    -
  • -
  • link=textPattern: -Select the link (anchor) element which contains text matching the -specified pattern.

    -
      -
    • link=The link text
    • -
    -
  • -
  • css=cssSelectorSyntax: -Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package.

    -
      -
    • css=a[href="#id3"]
    • -
    • css=span#firstChild + span
    • -
    -

    Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after).

    -
  • -
  • ui=uiSpecifierString: -Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details.

    -
      -
    • ui=loginPages::loginButton()
    • -
    • ui=settingsPages::toggle(label=Hide Email)
    • -
    • ui=forumPages::postBody(index=2)//a[2]
    • -
    -
  • -
-

Without an explicit locator prefix, Selenium uses the following default -strategies:

-
    -
  • dom, for locators starting with "document."
  • -
  • xpath, for locators starting with "//"
  • -
  • identifier, otherwise
  • -
-
-
-

Element Filters

-

Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator.

-

Filters look much like locators, ie.

-

filterType=argument

-

Supported element-filters are:

-

value=valuePattern

-

Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons.

-

index=index

-

Selects a single element based on its position in the list (offset from zero).

-
-
-

String-match Patterns

-

Various Pattern syntaxes are available for matching string values:

-
    -
  • glob:pattern: -Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a -kind of limited regular-expression syntax typically used in command-line -shells. In a glob pattern, "*" represents any sequence of characters, and "?" -represents any single character. Glob patterns match against the entire -string.

    -
  • -
  • regexp:regexp: -Match a string using a regular-expression. The full power of JavaScript -regular-expressions is available.

    -
  • -
  • regexpi:regexpi: -Match a string using a case-insensitive regular-expression.

    -
  • -
  • exact:string:

    -

    Match a string exactly, verbatim, without any of that fancy wildcard -stuff.

    -
  • -
-

If no pattern prefix is specified, Selenium assumes that it's a "glob" -pattern.

-

For commands that return multiple values (such as verifySelectOptions), -the string being matched is a comma-separated list of the return values, -where both commas and backslashes in the values are backslash-escaped. -When providing a pattern, the optional matching syntax (i.e. glob, -regexp, etc.) is specified once, as usual, at the beginning of the -pattern.

-


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
Instance Methods[hide private]
-
-   - - __init__(self, - host, - port, - browserStartCommand, - browserURL) - -
-   - - setExtensionJs(self, - extensionJs) - -
-   - - start(self) - -
-   - - stop(self) - -
-   - - do_command(self, - verb, - args) - -
-   - - get_string(self, - verb, - args) - -
-   - - get_string_array(self, - verb, - args) - -
-   - - get_number(self, - verb, - args) - -
-   - - get_number_array(self, - verb, - args) - -
-   - - get_boolean(self, - verb, - args) - -
-   - - get_boolean_array(self, - verb, - args) - -
-   - - click(self, - locator) -
Clicks on a link, button, checkbox or radio button. -
-   - - double_click(self, - locator) -
Double clicks on a link, button, checkbox or radio button. -
-   - - context_menu(self, - locator) -
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). -
-   - - click_at(self, - locator, - coordString) -
Clicks on a link, button, checkbox or radio button. -
-   - - double_click_at(self, - locator, - coordString) -
Doubleclicks on a link, button, checkbox or radio button. -
-   - - context_menu_at(self, - locator, - coordString) -
Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). -
-   - - fire_event(self, - locator, - eventName) -
Explicitly simulate an event, to trigger the corresponding "onevent" -handler. -
-   - - focus(self, - locator) -
Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. -
-   - - key_press(self, - locator, - keySequence) -
Simulates a user pressing and releasing a key. -
-   - - shift_key_down(self) -
Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. -
-   - - shift_key_up(self) -
Release the shift key. -
-   - - meta_key_down(self) -
Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. -
-   - - meta_key_up(self) -
Release the meta key. -
-   - - alt_key_down(self) -
Press the alt key and hold it down until doAltUp() is called or a new page is loaded. -
-   - - alt_key_up(self) -
Release the alt key. -
-   - - control_key_down(self) -
Press the control key and hold it down until doControlUp() is called or a new page is loaded. -
-   - - control_key_up(self) -
Release the control key. -
-   - - key_down(self, - locator, - keySequence) -
Simulates a user pressing a key (without releasing it yet). -
-   - - key_up(self, - locator, - keySequence) -
Simulates a user releasing a key. -
-   - - mouse_over(self, - locator) -
Simulates a user hovering a mouse over the specified element. -
-   - - mouse_out(self, - locator) -
Simulates a user moving the mouse pointer away from the specified element. -
-   - - mouse_down(self, - locator) -
Simulates a user pressing the left mouse button (without releasing it yet) on -the specified element. -
-   - - mouse_down_right(self, - locator) -
Simulates a user pressing the right mouse button (without releasing it yet) on -the specified element. -
-   - - mouse_down_at(self, - locator, - coordString) -
Simulates a user pressing the left mouse button (without releasing it yet) at -the specified location. -
-   - - mouse_down_right_at(self, - locator, - coordString) -
Simulates a user pressing the right mouse button (without releasing it yet) at -the specified location. -
-   - - mouse_up(self, - locator) -
Simulates the event that occurs when the user releases the mouse button (i.e., stops -holding the button down) on the specified element. -
-   - - mouse_up_right(self, - locator) -
Simulates the event that occurs when the user releases the right mouse button (i.e., stops -holding the button down) on the specified element. -
-   - - mouse_up_at(self, - locator, - coordString) -
Simulates the event that occurs when the user releases the mouse button (i.e., stops -holding the button down) at the specified location. -
-   - - mouse_up_right_at(self, - locator, - coordString) -
Simulates the event that occurs when the user releases the right mouse button (i.e., stops -holding the button down) at the specified location. -
-   - - mouse_move(self, - locator) -
Simulates a user pressing the mouse button (without releasing it yet) on -the specified element. -
-   - - mouse_move_at(self, - locator, - coordString) -
Simulates a user pressing the mouse button (without releasing it yet) on -the specified element. -
-   - - type(self, - locator, - value) -
Sets the value of an input field, as though you typed it in. -
-   - - type_keys(self, - locator, - value) -
Simulates keystroke events on the specified element, as though you typed the value key-by-key. -
-   - - set_speed(self, - value) -
Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). -
-   - - get_speed(self) -
Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). -
-   - - check(self, - locator) -
Check a toggle-button (checkbox/radio) -
-   - - uncheck(self, - locator) -
Uncheck a toggle-button (checkbox/radio) -
-   - - select(self, - selectLocator, - optionLocator) -
Select an option from a drop-down using an option locator. -
-   - - add_selection(self, - locator, - optionLocator) -
Add a selection to the set of selected options in a multi-select element using an option locator. -
-   - - remove_selection(self, - locator, - optionLocator) -
Remove a selection from the set of selected options in a multi-select element using an option locator. -
-   - - remove_all_selections(self, - locator) -
Unselects all of the selected options in a multi-select element. -
-   - - submit(self, - formLocator) -
Submit the specified form. -
-   - - open(self, - url) -
Opens an URL in the test frame. -
-   - - open_window(self, - url, - windowID) -
Opens a popup window (if a window with that ID isn't already open). -
-   - - select_window(self, - windowID) -
Selects a popup window using a window locator; once a popup window has been selected, all -commands go to that window. -
-   - - select_pop_up(self, - windowID) -
Simplifies the process of selecting a popup window (and does not offer -functionality beyond what selectWindow() already provides). -
-   - - deselect_pop_up(self) -
Selects the main window. -
-   - - select_frame(self, - locator) -
Selects a frame within the current window. -
-   - - get_whether_this_frame_match_frame_expression(self, - currentFrameString, - target) -
Determine whether current/locator identify the frame containing this running code. -
-   - - get_whether_this_window_match_window_expression(self, - currentWindowString, - target) -
Determine whether currentWindowString plus target identify the window containing this running code. -
-   - - wait_for_pop_up(self, - windowID, - timeout) -
Waits for a popup window to appear and load up. -
-   - - choose_cancel_on_next_confirmation(self) -
By default, Selenium's overridden window.confirm() function will -return true, as if the user had manually clicked OK; after running -this command, the next call to confirm() will return false, as if -the user had clicked Cancel. -
-   - - choose_ok_on_next_confirmation(self) -
Undo the effect of calling chooseCancelOnNextConfirmation. -
-   - - answer_on_next_prompt(self, - answer) -
Instructs Selenium to return the specified answer string in response to -the next JavaScript prompt [window.prompt()]. -
-   - - go_back(self) -
Simulates the user clicking the "back" button on their browser. -
-   - - refresh(self) -
Simulates the user clicking the "Refresh" button on their browser. -
-   - - close(self) -
Simulates the user clicking the "close" button in the titlebar of a popup -window or tab. -
-   - - is_alert_present(self) -
Has an alert occurred? -
-   - - is_prompt_present(self) -
Has a prompt occurred? -
-   - - is_confirmation_present(self) -
Has confirm() been called? -
-   - - get_alert(self) -
Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. -
-   - - get_confirmation(self) -
Retrieves the message of a JavaScript confirmation dialog generated during -the previous action. -
-   - - get_prompt(self) -
Retrieves the message of a JavaScript question prompt dialog generated during -the previous action. -
-   - - get_location(self) -
Gets the absolute URL of the current page. -
-   - - get_title(self) -
Gets the title of the current page. -
-   - - get_body_text(self) -
Gets the entire text of the page. -
-   - - get_value(self, - locator) -
Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). -
-   - - get_text(self, - locator) -
Gets the text of an element. -
-   - - highlight(self, - locator) -
Briefly changes the backgroundColor of the specified element yellow. -
-   - - get_eval(self, - script) -
Gets the result of evaluating the specified JavaScript snippet. -
-   - - is_checked(self, - locator) -
Gets whether a toggle-button (checkbox/radio) is checked. -
-   - - get_table(self, - tableCellAddress) -
Gets the text from a cell of a table. -
-   - - get_selected_labels(self, - selectLocator) -
Gets all option labels (visible text) for selected options in the specified select or multi-select element. -
-   - - get_selected_label(self, - selectLocator) -
Gets option label (visible text) for selected option in the specified select element. -
-   - - get_selected_values(self, - selectLocator) -
Gets all option values (value attributes) for selected options in the specified select or multi-select element. -
-   - - get_selected_value(self, - selectLocator) -
Gets option value (value attribute) for selected option in the specified select element. -
-   - - get_selected_indexes(self, - selectLocator) -
Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. -
-   - - get_selected_index(self, - selectLocator) -
Gets option index (option number, starting at 0) for selected option in the specified select element. -
-   - - get_selected_ids(self, - selectLocator) -
Gets all option element IDs for selected options in the specified select or multi-select element. -
-   - - get_selected_id(self, - selectLocator) -
Gets option element ID for selected option in the specified select element. -
-   - - is_something_selected(self, - selectLocator) -
Determines whether some option in a drop-down menu is selected. -
-   - - get_select_options(self, - selectLocator) -
Gets all option labels in the specified select drop-down. -
-   - - get_attribute(self, - attributeLocator) -
Gets the value of an element attribute. -
-   - - is_text_present(self, - pattern) -
Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. -
-   - - is_element_present(self, - locator) -
Verifies that the specified element is somewhere on the page. -
-   - - is_visible(self, - locator) -
Determines if the specified element is visible. -
-   - - is_editable(self, - locator) -
Determines whether the specified input element is editable, ie hasn't been disabled. -
-   - - get_all_buttons(self) -
Returns the IDs of all buttons on the page. -
-   - - get_all_links(self) -
Returns the IDs of all links on the page. -
-   - - get_all_fields(self) -
Returns the IDs of all input fields on the page. -
-   - - get_attribute_from_all_windows(self, - attributeName) -
Returns every instance of some attribute from all known windows. -
-   - - dragdrop(self, - locator, - movementsString) -
deprecated - use dragAndDrop instead -
-   - - set_mouse_speed(self, - pixels) -
Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). -
-   - - get_mouse_speed(self) -
Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). -
-   - - drag_and_drop(self, - locator, - movementsString) -
Drags an element a certain distance and then drops it -
-   - - drag_and_drop_to_object(self, - locatorOfObjectToBeDragged, - locatorOfDragDestinationObject) -
Drags an element and drops it on another element -
-   - - window_focus(self) -
Gives focus to the currently selected window -
-   - - window_maximize(self) -
Resize currently selected window to take up the entire screen -
-   - - get_all_window_ids(self) -
Returns the IDs of all windows that the browser knows about. -
-   - - get_all_window_names(self) -
Returns the names of all windows that the browser knows about. -
-   - - get_all_window_titles(self) -
Returns the titles of all windows that the browser knows about. -
-   - - get_html_source(self) -
Returns the entire HTML source between the opening and -closing "html" tags. -
-   - - set_cursor_position(self, - locator, - position) -
Moves the text cursor to the specified position in the given input element or textarea. -
-   - - get_element_index(self, - locator) -
Get the relative index of an element to its parent (starting from 0). -
-   - - is_ordered(self, - locator1, - locator2) -
Check if these two elements have same parent and are ordered siblings in the DOM. -
-   - - get_element_position_left(self, - locator) -
Retrieves the horizontal position of an element -
-   - - get_element_position_top(self, - locator) -
Retrieves the vertical position of an element -
-   - - get_element_width(self, - locator) -
Retrieves the width of an element -
-   - - get_element_height(self, - locator) -
Retrieves the height of an element -
-   - - get_cursor_position(self, - locator) -
Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. -
-   - - get_expression(self, - expression) -
Returns the specified expression. -
-   - - get_xpath_count(self, - xpath) -
Returns the number of nodes that match the specified xpath, eg. -
-   - - assign_id(self, - locator, - identifier) -
Temporarily sets the "id" attribute of the specified element, so you can locate it in the future -using its ID rather than a slow/complicated XPath. -
-   - - allow_native_xpath(self, - allow) -
Specifies whether Selenium should use the native in-browser implementation -of XPath (if any native version is available); if you pass "false" to -this function, we will always use our pure-JavaScript xpath library. -
-   - - ignore_attributes_without_value(self, - ignore) -
Specifies whether Selenium will ignore xpath attributes that have no -value, i.e. -
-   - - wait_for_condition(self, - script, - timeout) -
Runs the specified JavaScript snippet repeatedly until it evaluates to "true". -
-   - - set_timeout(self, - timeout) -
Specifies the amount of time that Selenium will wait for actions to complete. -
-   - - wait_for_page_to_load(self, - timeout) -
Waits for a new page to load. -
-   - - wait_for_frame_to_load(self, - frameAddress, - timeout) -
Waits for a new frame to load. -
-   - - get_cookie(self) -
Return all cookies of the current page under test. -
-   - - get_cookie_by_name(self, - name) -
Returns the value of the cookie with the specified name, or throws an error if the cookie is not present. -
-   - - is_cookie_present(self, - name) -
Returns true if a cookie with the specified name is present, or false otherwise. -
-   - - create_cookie(self, - nameValuePair, - optionsString) -
Create a new cookie whose path and domain are same with those of current page -under test, unless you specified a path for this cookie explicitly. -
-   - - delete_cookie(self, - name, - optionsString) -
Delete a named cookie with specified path and domain. -
-   - - delete_all_visible_cookies(self) -
Calls deleteCookie with recurse=true on all cookies visible to the current page. -
-   - - set_browser_log_level(self, - logLevel) -
Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. -
-   - - run_script(self, - script) -
Creates a new "script" tag in the body of the current test window, and -adds the specified text into the body of the command. -
-   - - add_location_strategy(self, - strategyName, - functionDefinition) -
Defines a new function for Selenium to locate elements on the page. -
-   - - capture_entire_page_screenshot(self, - filename, - kwargs) -
Saves the entire contents of the current window canvas to a PNG file. -
-   - - rollup(self, - rollupName, - kwargs) -
Executes a command rollup, which is a series of commands with a unique -name, and optionally arguments that control the generation of the set of -commands. -
-   - - add_script(self, - scriptContent, - scriptTagId) -
Loads script content into a new script tag in the Selenium document. -
-   - - remove_script(self, - scriptTagId) -
Removes a script tag from the Selenium document identified by the given -id. -
-   - - use_xpath_library(self, - libraryName) -
Allows choice of one of the available libraries. -
-   - - set_context(self, - context) -
Writes a message to the status bar and adds a note to the browser-side -log. -
-   - - attach_file(self, - fieldLocator, - fileLocator) -
Sets a file input (upload) field to the file listed in fileLocator -
-   - - capture_screenshot(self, - filename) -
Captures a PNG screenshot to the specified file. -
-   - - capture_screenshot_to_string(self) -
Capture a PNG screenshot. -
-   - - captureNetworkTraffic(self, - type) -
Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. -
-   - - addCustomRequestHeader(self, - key, - value) -
Tells the Selenium server to add the specificed key and value as a custom outgoing request header. -
-   - - capture_entire_page_screenshot_to_string(self, - kwargs) -
Downloads a screenshot of the browser current window canvas to a -based 64 encoded PNG file. -
-   - - shut_down_selenium_server(self) -
Kills the running Selenium Server and all browser sessions. -
-   - - retrieve_last_remote_control_logs(self) -
Retrieve the last messages logged on a specific remote control. -
-   - - key_down_native(self, - keycode) -
Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. -
-   - - key_up_native(self, - keycode) -
Simulates a user releasing a key by sending a native operating system keystroke. -
-   - - key_press_native(self, - keycode) -
Simulates a user pressing and releasing a key by sending a native operating system keystroke. -
- -
- - - - - - -
- - - - - -
Method Details[hide private]
-
- -
-
- - -
-

__init__(self, - host, - port, - browserStartCommand, - browserURL) -
(Constructor) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

setExtensionJs(self, - extensionJs) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

start(self) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

stop(self) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

do_command(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_string(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_string_array(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_number(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_number_array(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_boolean(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

get_boolean_array(self, - verb, - args) -

-
source code 
- - -
-
-
-
- -
-
- - -
-

click(self, - locator) -

-
source code 
- -

Clicks on a link, button, checkbox or radio button. If the click action -causes a new page to load (like a link usually does), call -waitForPageToLoad.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

double_click(self, - locator) -

-
source code 
- -

Double clicks on a link, button, checkbox or radio button. If the double click action -causes a new page to load (like a link usually does), call -waitForPageToLoad.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

context_menu(self, - locator) -

-
source code 
- -

Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

click_at(self, - locator, - coordString) -

-
source code 
- -

Clicks on a link, button, checkbox or radio button. If the click action -causes a new page to load (like a link usually does), call -waitForPageToLoad.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

double_click_at(self, - locator, - coordString) -

-
source code 
- -

Doubleclicks on a link, button, checkbox or radio button. If the action -causes a new page to load (like a link usually does), call -waitForPageToLoad.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

context_menu_at(self, - locator, - coordString) -

-
source code 
- -

Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element).

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

fire_event(self, - locator, - eventName) -

-
source code 
- -

Explicitly simulate an event, to trigger the corresponding "onevent" -handler.

-

'locator' is an element locator -'eventName' is the event name, e.g. "focus" or "blur"

-
-
-
-
- -
-
- - -
-

focus(self, - locator) -

-
source code 
- -

Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

key_press(self, - locator, - keySequence) -

-
source code 
- -

Simulates a user pressing and releasing a key.

-

'locator' is an element locator -'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9".

-
-
-
-
- -
-
- - -
-

shift_key_down(self) -

-
source code 
- - Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. -
-
-
-
- -
-
- - -
-

shift_key_up(self) -

-
source code 
- - Release the shift key. -
-
-
-
- -
-
- - -
-

meta_key_down(self) -

-
source code 
- - Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. -
-
-
-
- -
-
- - -
-

meta_key_up(self) -

-
source code 
- - Release the meta key. -
-
-
-
- -
-
- - -
-

alt_key_down(self) -

-
source code 
- - Press the alt key and hold it down until doAltUp() is called or a new page is loaded. -
-
-
-
- -
-
- - -
-

alt_key_up(self) -

-
source code 
- - Release the alt key. -
-
-
-
- -
-
- - -
-

control_key_down(self) -

-
source code 
- - Press the control key and hold it down until doControlUp() is called or a new page is loaded. -
-
-
-
- -
-
- - -
-

control_key_up(self) -

-
source code 
- - Release the control key. -
-
-
-
- -
-
- - -
-

key_down(self, - locator, - keySequence) -

-
source code 
- -

Simulates a user pressing a key (without releasing it yet).

-

'locator' is an element locator -'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9".

-
-
-
-
- -
-
- - -
-

key_up(self, - locator, - keySequence) -

-
source code 
- -

Simulates a user releasing a key.

-

'locator' is an element locator -'keySequence' is Either be a string("" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", " 9".

-
-
-
-
- -
-
- - -
-

mouse_over(self, - locator) -

-
source code 
- -

Simulates a user hovering a mouse over the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_out(self, - locator) -

-
source code 
- -

Simulates a user moving the mouse pointer away from the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_down(self, - locator) -

-
source code 
- -

Simulates a user pressing the left mouse button (without releasing it yet) on -the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_down_right(self, - locator) -

-
source code 
- -

Simulates a user pressing the right mouse button (without releasing it yet) on -the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_down_at(self, - locator, - coordString) -

-
source code 
- -

Simulates a user pressing the left mouse button (without releasing it yet) at -the specified location.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

mouse_down_right_at(self, - locator, - coordString) -

-
source code 
- -

Simulates a user pressing the right mouse button (without releasing it yet) at -the specified location.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

mouse_up(self, - locator) -

-
source code 
- -

Simulates the event that occurs when the user releases the mouse button (i.e., stops -holding the button down) on the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_up_right(self, - locator) -

-
source code 
- -

Simulates the event that occurs when the user releases the right mouse button (i.e., stops -holding the button down) on the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_up_at(self, - locator, - coordString) -

-
source code 
- -

Simulates the event that occurs when the user releases the mouse button (i.e., stops -holding the button down) at the specified location.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

mouse_up_right_at(self, - locator, - coordString) -

-
source code 
- -

Simulates the event that occurs when the user releases the right mouse button (i.e., stops -holding the button down) at the specified location.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

mouse_move(self, - locator) -

-
source code 
- -

Simulates a user pressing the mouse button (without releasing it yet) on -the specified element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

mouse_move_at(self, - locator, - coordString) -

-
source code 
- -

Simulates a user pressing the mouse button (without releasing it yet) on -the specified element.

-

'locator' is an element locator -'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator.

-
-
-
-
- -
-
- - -
-

type(self, - locator, - value) -

-
source code 
- -

Sets the value of an input field, as though you typed it in.

-

Can also be used to set the value of combo boxes, check boxes, etc. In these cases, -value should be the value of the option selected, not the visible text.

-

'locator' is an element locator -'value' is the value to type

-
-
-
-
- -
-
- - -
-

type_keys(self, - locator, - value) -

-
source code 
- -

Simulates keystroke events on the specified element, as though you typed the value key-by-key.

-

This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; -this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events.

-

Unlike the simple "type" command, which forces the specified value into the page directly, this command -may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. -For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in -the field.

-

In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to -send the keystroke events corresponding to what you just typed.

-

'locator' is an element locator -'value' is the value to type

-
-
-
-
- -
-
- - -
-

set_speed(self, - value) -

-
source code 
- -

Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., -the delay is 0 milliseconds.

-

'value' is the number of milliseconds to pause after operation

-
-
-
-
- -
-
- - -
-

get_speed(self) -

-
source code 
- -

Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., -the delay is 0 milliseconds.

-

See also setSpeed.

-
-
-
-
- -
-
- - -
-

check(self, - locator) -

-
source code 
- -

Check a toggle-button (checkbox/radio)

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

uncheck(self, - locator) -

-
source code 
- -

Uncheck a toggle-button (checkbox/radio)

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

select(self, - selectLocator, - optionLocator) -

-
source code 
- -

Select an option from a drop-down using an option locator.

-

Option locators provide different ways of specifying options of an HTML -Select element (e.g. for selecting a specific option, or for asserting -that the selected option satisfies a specification). There are several -forms of Select Option Locator.

-
    -
  • label=labelPattern: -matches options based on their labels, i.e. the visible text. (This -is the default.)

    -
      -
    • label=regexp:^[Oo]ther
    • -
    -
  • -
  • value=valuePattern: -matches options based on their values.

    -
      -
    • value=other
    • -
    -
  • -
  • id=id:

    -

    matches options based on their ids.

    -
      -
    • id=option1
    • -
    -
  • -
  • index=index: -matches an option based on its index (offset from zero).

    -
      -
    • index=2
    • -
    -
  • -
-

If no option locator prefix is provided, the default behaviour is to match on label.

-

'selectLocator' is an element locator identifying a drop-down menu -'optionLocator' is an option locator (a label by default)

-
-
-
-
- -
-
- - -
-

add_selection(self, - locator, - optionLocator) -

-
source code 
- -

Add a selection to the set of selected options in a multi-select element using an option locator.

-

@see #doSelect for details of option locators

-

'locator' is an element locator identifying a multi-select box -'optionLocator' is an option locator (a label by default)

-
-
-
-
- -
-
- - -
-

remove_selection(self, - locator, - optionLocator) -

-
source code 
- -

Remove a selection from the set of selected options in a multi-select element using an option locator.

-

@see #doSelect for details of option locators

-

'locator' is an element locator identifying a multi-select box -'optionLocator' is an option locator (a label by default)

-
-
-
-
- -
-
- - -
-

remove_all_selections(self, - locator) -

-
source code 
- -

Unselects all of the selected options in a multi-select element.

-

'locator' is an element locator identifying a multi-select box

-
-
-
-
- -
-
- - -
-

submit(self, - formLocator) -

-
source code 
- -

Submit the specified form. This is particularly useful for forms without -submit buttons, e.g. single-input "Search" forms.

-

'formLocator' is an element locator for the form you want to submit

-
-
-
-
- -
-
- - -
-

open(self, - url) -

-
source code 
- -

Opens an URL in the test frame. This accepts both relative and absolute -URLs.

-

The "open" command waits for the page to load before proceeding, -ie. the "AndWait" suffix is implicit.

-

Note: The URL must be on the same domain as the runner HTML -due to security restrictions in the browser (Same Origin Policy). If you -need to open an URL on another domain, use the Selenium Server to start a -new browser session on that domain.

-

'url' is the URL to open; may be relative or absolute

-
-
-
-
- -
-
- - -
-

open_window(self, - url, - windowID) -

-
source code 
- -

Opens a popup window (if a window with that ID isn't already open). -After opening the window, you'll need to select it using the selectWindow -command.

-

This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). -In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using -an empty (blank) url, like this: openWindow("", "myFunnyWindow").

-

'url' is the URL to open, which can be blank -'windowID' is the JavaScript window ID of the window to select

-
-
-
-
- -
-
- - -
-

select_window(self, - windowID) -

-
source code 
- -

Selects a popup window using a window locator; once a popup window has been selected, all -commands go to that window. To select the main window again, use null -as the target.

-

Window locators provide different ways of specifying the window object: -by title, by internal JavaScript "name," or by JavaScript variable.

-
    -
  • title=My Special Window: -Finds the window using the text that appears in the title bar. Be careful; -two windows can share the same title. If that happens, this locator will -just pick one.
  • -
  • name=myWindow: -Finds the window using its internal JavaScript "name" property. This is the second -parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) -(which Selenium intercepts).
  • -
  • var=variableName: -Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current -application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using -"var=foo".
  • -
-

If no window locator prefix is provided, we'll try to guess what you mean like this:

-

1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser).

-

2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed -that this variable contains the return value from a call to the JavaScript window.open() method.

-

3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names".

-

4.) If that fails, we'll try looping over all of the known windows to try to find the appropriate "title". -Since "title" is not necessarily unique, this may have unexpected behavior.

-

If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages -which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages -like the following for each window as it is opened:

-

debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"

-

In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). -(This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using -an empty (blank) url, like this: openWindow("", "myFunnyWindow").

-

'windowID' is the JavaScript window ID of the window to select

-
-
-
-
- -
-
- - -
-

select_pop_up(self, - windowID) -

-
source code 
- -

Simplifies the process of selecting a popup window (and does not offer -functionality beyond what selectWindow() already provides).

-
    -
  • If windowID is either not specified, or specified as -"null", the first non-top window is selected. The top window is the one -that would be selected by selectWindow() without providing a -windowID . This should not be used when more than one popup -window is in play.
  • -
  • Otherwise, the window will be looked up considering -windowID as the following in order: 1) the "name" of the -window, as specified to window.open(); 2) a javascript -variable which is a reference to a window; and 3) the title of the -window. This is the same ordered lookup performed by -selectWindow .
  • -
-

'windowID' is an identifier for the popup window, which can take on a number of different meanings

-
-
-
-
- -
-
- - -
-

deselect_pop_up(self) -

-
source code 
- - Selects the main window. Functionally equivalent to using -selectWindow() and specifying no value for -windowID. -
-
-
-
- -
-
- - -
-

select_frame(self, - locator) -

-
source code 
- -

Selects a frame within the current window. (You may invoke this command -multiple times to select nested frames.) To select the parent frame, use -"relative=parent" as a locator; to select the top frame, use "relative=top". -You can also select a frame by its 0-based index number; select the first frame with -"index=0", or the third frame with "index=2".

-

You may also use a DOM expression to identify the frame you want directly, -like this: dom=frames["main"].frames["subframe"]

-

'locator' is an element locator identifying a frame or iframe

-
-
-
-
- -
-
- - -
-

get_whether_this_frame_match_frame_expression(self, - currentFrameString, - target) -

-
source code 
- -

Determine whether current/locator identify the frame containing this running code.

-

This is useful in proxy injection mode, where this code runs in every -browser frame and window, and sometimes the selenium server needs to identify -the "current" frame. In this case, when the test calls selectFrame, this -routine is called for each frame to figure out which one has been selected. -The selected frame will return true, while all others will return false.

-

'currentFrameString' is starting frame -'target' is new frame (which might be relative to the current one)

-
-
-
-
- -
-
- - -
-

get_whether_this_window_match_window_expression(self, - currentWindowString, - target) -

-
source code 
- -

Determine whether currentWindowString plus target identify the window containing this running code.

-

This is useful in proxy injection mode, where this code runs in every -browser frame and window, and sometimes the selenium server needs to identify -the "current" window. In this case, when the test calls selectWindow, this -routine is called for each window to figure out which one has been selected. -The selected window will return true, while all others will return false.

-

'currentWindowString' is starting window -'target' is new window (which might be relative to the current one, e.g., "_parent")

-
-
-
-
- -
-
- - -
-

wait_for_pop_up(self, - windowID, - timeout) -

-
source code 
- -

Waits for a popup window to appear and load up.

-

'windowID' is the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously). -'timeout' is a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command.

-
-
-
-
- -
-
- - -
-

choose_cancel_on_next_confirmation(self) -

-
source code 
- -

By default, Selenium's overridden window.confirm() function will -return true, as if the user had manually clicked OK; after running -this command, the next call to confirm() will return false, as if -the user had clicked Cancel. Selenium will then resume using the -default behavior for future confirmations, automatically returning -true (OK) unless/until you explicitly call this command for each -confirmation.

-

Take note - every time a confirmation comes up, you must -consume it with a corresponding getConfirmation, or else -the next selenium operation will fail.

-
-
-
-
- -
-
- - -
-

choose_ok_on_next_confirmation(self) -

-
source code 
- -

Undo the effect of calling chooseCancelOnNextConfirmation. Note -that Selenium's overridden window.confirm() function will normally automatically -return true, as if the user had manually clicked OK, so you shouldn't -need to use this command unless for some reason you need to change -your mind prior to the next confirmation. After any confirmation, Selenium will resume using the -default behavior for future confirmations, automatically returning -true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each -confirmation.

-

Take note - every time a confirmation comes up, you must -consume it with a corresponding getConfirmation, or else -the next selenium operation will fail.

-
-
-
-
- -
-
- - -
-

answer_on_next_prompt(self, - answer) -

-
source code 
- -

Instructs Selenium to return the specified answer string in response to -the next JavaScript prompt [window.prompt()].

-

'answer' is the answer to give in response to the prompt pop-up

-
-
-
-
- -
-
- - -
-

go_back(self) -

-
source code 
- - Simulates the user clicking the "back" button on their browser. -
-
-
-
- -
-
- - -
-

refresh(self) -

-
source code 
- - Simulates the user clicking the "Refresh" button on their browser. -
-
-
-
- -
-
- - -
-

close(self) -

-
source code 
- - Simulates the user clicking the "close" button in the titlebar of a popup -window or tab. -
-
-
-
- -
-
- - -
-

is_alert_present(self) -

-
source code 
- -

Has an alert occurred?

-

This function never throws an exception

-
-
-
-
- -
-
- - -
-

is_prompt_present(self) -

-
source code 
- -

Has a prompt occurred?

-

This function never throws an exception

-
-
-
-
- -
-
- - -
-

is_confirmation_present(self) -

-
source code 
- -

Has confirm() been called?

-

This function never throws an exception

-
-
-
-
- -
-
- - -
-

get_alert(self) -

-
source code 
- -

Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts.

-

Getting an alert has the same effect as manually clicking OK. If an -alert is generated but you do not consume it with getAlert, the next Selenium action -will fail.

-

Under Selenium, JavaScript alerts will NOT pop up a visible alert -dialog.

-

Selenium does NOT support JavaScript alerts that are generated in a -page's onload() event handler. In this case a visible dialog WILL be -generated and Selenium will hang until someone manually clicks OK.

-
-
-
-
- -
-
- - -
-

get_confirmation(self) -

-
source code 
- -

Retrieves the message of a JavaScript confirmation dialog generated during -the previous action.

-

By default, the confirm function will return true, having the same effect -as manually clicking OK. This can be changed by prior execution of the -chooseCancelOnNextConfirmation command.

-

If an confirmation is generated but you do not consume it with getConfirmation, -the next Selenium action will fail.

-

NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible -dialog.

-

NOTE: Selenium does NOT support JavaScript confirmations that are -generated in a page's onload() event handler. In this case a visible -dialog WILL be generated and Selenium will hang until you manually click -OK.

-
-
-
-
- -
-
- - -
-

get_prompt(self) -

-
source code 
- -

Retrieves the message of a JavaScript question prompt dialog generated during -the previous action.

-

Successful handling of the prompt requires prior execution of the -answerOnNextPrompt command. If a prompt is generated but you -do not get/verify it, the next Selenium action will fail.

-

NOTE: under Selenium, JavaScript prompts will NOT pop up a visible -dialog.

-

NOTE: Selenium does NOT support JavaScript prompts that are generated in a -page's onload() event handler. In this case a visible dialog WILL be -generated and Selenium will hang until someone manually clicks OK.

-
-
-
-
- -
-
- - -
-

get_location(self) -

-
source code 
- - Gets the absolute URL of the current page. -
-
-
-
- -
-
- - -
-

get_title(self) -

-
source code 
- - Gets the title of the current page. -
-
-
-
- -
-
- - -
-

get_body_text(self) -

-
source code 
- - Gets the entire text of the page. -
-
-
-
- -
-
- - -
-

get_value(self, - locator) -

-
source code 
- -

Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). -For checkbox/radio elements, the value will be "on" or "off" depending on -whether the element is checked or not.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

get_text(self, - locator) -

-
source code 
- -

Gets the text of an element. This works for any element that contains -text. This command uses either the textContent (Mozilla-like browsers) or -the innerText (IE-like browsers) of the element, which is the rendered -text shown to the user.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

highlight(self, - locator) -

-
source code 
- -

Briefly changes the backgroundColor of the specified element yellow. Useful for debugging.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

get_eval(self, - script) -

-
source code 
- -

Gets the result of evaluating the specified JavaScript snippet. The snippet may -have multiple lines, but only the result of the last line will be returned.

-

Note that, by default, the snippet will run in the context of the "selenium" -object itself, so this will refer to the Selenium object. Use window to -refer to the window of your application, e.g. window.document.getElementById('foo')

-

If you need to use -a locator to refer to a single element in your application page, you can -use this.browserbot.findElement("id=foo") where "id=foo" is your locator.

-

'script' is the JavaScript snippet to run

-
-
-
-
- -
-
- - -
-

is_checked(self, - locator) -

-
source code 
- -

Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button.

-

'locator' is an element locator pointing to a checkbox or radio button

-
-
-
-
- -
-
- - -
-

get_table(self, - tableCellAddress) -

-
source code 
- -

Gets the text from a cell of a table. The cellAddress syntax -tableLocator.row.column, where row and column start at 0.

-

'tableCellAddress' is a cell address, e.g. "foo.1.4"

-
-
-
-
- -
-
- - -
-

get_selected_labels(self, - selectLocator) -

-
source code 
- -

Gets all option labels (visible text) for selected options in the specified select or multi-select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_label(self, - selectLocator) -

-
source code 
- -

Gets option label (visible text) for selected option in the specified select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_values(self, - selectLocator) -

-
source code 
- -

Gets all option values (value attributes) for selected options in the specified select or multi-select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_value(self, - selectLocator) -

-
source code 
- -

Gets option value (value attribute) for selected option in the specified select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_indexes(self, - selectLocator) -

-
source code 
- -

Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_index(self, - selectLocator) -

-
source code 
- -

Gets option index (option number, starting at 0) for selected option in the specified select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_ids(self, - selectLocator) -

-
source code 
- -

Gets all option element IDs for selected options in the specified select or multi-select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_selected_id(self, - selectLocator) -

-
source code 
- -

Gets option element ID for selected option in the specified select element.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

is_something_selected(self, - selectLocator) -

-
source code 
- -

Determines whether some option in a drop-down menu is selected.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_select_options(self, - selectLocator) -

-
source code 
- -

Gets all option labels in the specified select drop-down.

-

'selectLocator' is an element locator identifying a drop-down menu

-
-
-
-
- -
-
- - -
-

get_attribute(self, - attributeLocator) -

-
source code 
- -

Gets the value of an element attribute. The value of the attribute may -differ across browsers (this is the case for the "style" attribute, for -example).

-

'attributeLocator' is an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar"

-
-
-
-
- -
-
- - -
-

is_text_present(self, - pattern) -

-
source code 
- -

Verifies that the specified text pattern appears somewhere on the rendered page shown to the user.

-

'pattern' is a pattern to match with the text of the page

-
-
-
-
- -
-
- - -
-

is_element_present(self, - locator) -

-
source code 
- -

Verifies that the specified element is somewhere on the page.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

is_visible(self, - locator) -

-
source code 
- -

Determines if the specified element is visible. An -element can be rendered invisible by setting the CSS "visibility" -property to "hidden", or the "display" property to "none", either for the -element itself or one if its ancestors. This method will fail if -the element is not present.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

is_editable(self, - locator) -

-
source code 
- -

Determines whether the specified input element is editable, ie hasn't been disabled. -This method will fail if the specified element isn't an input element.

-

'locator' is an element locator

-
-
-
-
- -
-
- - -
-

get_all_buttons(self) -

-
source code 
- -

Returns the IDs of all buttons on the page.

-

If a given button has no ID, it will appear as "" in this array.

-
-
-
-
- -
-
- - -
-

get_all_links(self) -

-
source code 
- -

Returns the IDs of all links on the page.

-

If a given link has no ID, it will appear as "" in this array.

-
-
-
-
- -
-
- - -
-

get_all_fields(self) -

-
source code 
- -

Returns the IDs of all input fields on the page.

-

If a given field has no ID, it will appear as "" in this array.

-
-
-
-
- -
-
- - -
-

get_attribute_from_all_windows(self, - attributeName) -

-
source code 
- -

Returns every instance of some attribute from all known windows.

-

'attributeName' is name of an attribute on the windows

-
-
-
-
- -
-
- - -
-

dragdrop(self, - locator, - movementsString) -

-
source code 
- -

deprecated - use dragAndDrop instead

-

'locator' is an element locator -'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

-
-
-
-
- -
-
- - -
-

set_mouse_speed(self, - pixels) -

-
source code 
- -

Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10).

-

Setting this value to 0 means that we'll send a "mousemove" event to every single pixel -in between the start location and the end location; that can be very slow, and may -cause some browsers to force the JavaScript to timeout.

-

If the mouse speed is greater than the distance between the two dragged objects, we'll -just send one "mousemove" at the start location and then one final one at the end location.

-

'pixels' is the number of pixels between "mousemove" events

-
-
-
-
- -
-
- - -
-

get_mouse_speed(self) -

-
source code 
- - Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). -
-
-
-
- -
-
- - -
-

drag_and_drop(self, - locator, - movementsString) -

-
source code 
- -

Drags an element a certain distance and then drops it

-

'locator' is an element locator -'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300"

-
-
-
-
- -
-
- - -
-

drag_and_drop_to_object(self, - locatorOfObjectToBeDragged, - locatorOfDragDestinationObject) -

-
source code 
- -

Drags an element and drops it on another element

-

'locatorOfObjectToBeDragged' is an element to be dragged -'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped

-
-
-
-
- -
-
- - -
-

window_focus(self) -

-
source code 
- - Gives focus to the currently selected window -
-
-
-
- -
-
- - -
-

window_maximize(self) -

-
source code 
- - Resize currently selected window to take up the entire screen -
-
-
-
- -
-
- - -
-

get_all_window_ids(self) -

-
source code 
- - Returns the IDs of all windows that the browser knows about. -
-
-
-
- -
-
- - -
-

get_all_window_names(self) -

-
source code 
- - Returns the names of all windows that the browser knows about. -
-
-
-
- -
-
- - -
-

get_all_window_titles(self) -

-
source code 
- - Returns the titles of all windows that the browser knows about. -
-
-
-
- -
-
- - -
-

get_html_source(self) -

-
source code 
- - Returns the entire HTML source between the opening and -closing "html" tags. -
-
-
-
- -
-
- - -
-

set_cursor_position(self, - locator, - position) -

-
source code 
- -

Moves the text cursor to the specified position in the given input element or textarea. -This method will fail if the specified element isn't an input element or textarea.

-

'locator' is an element locator pointing to an input element or textarea -'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field.

-
-
-
-
- -
-
- - -
-

get_element_index(self, - locator) -

-
source code 
- -

Get the relative index of an element to its parent (starting from 0). The comment node and empty text node -will be ignored.

-

'locator' is an element locator pointing to an element

-
-
-
-
- -
-
- - -
-

is_ordered(self, - locator1, - locator2) -

-
source code 
- -

Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will -not be considered ordered.

-

'locator1' is an element locator pointing to the first element -'locator2' is an element locator pointing to the second element

-
-
-
-
- -
-
- - -
-

get_element_position_left(self, - locator) -

-
source code 
- -

Retrieves the horizontal position of an element

-

'locator' is an element locator pointing to an element OR an element itself

-
-
-
-
- -
-
- - -
-

get_element_position_top(self, - locator) -

-
source code 
- -

Retrieves the vertical position of an element

-

'locator' is an element locator pointing to an element OR an element itself

-
-
-
-
- -
-
- - -
-

get_element_width(self, - locator) -

-
source code 
- -

Retrieves the width of an element

-

'locator' is an element locator pointing to an element

-
-
-
-
- -
-
- - -
-

get_element_height(self, - locator) -

-
source code 
- -

Retrieves the height of an element

-

'locator' is an element locator pointing to an element

-
-
-
-
- -
-
- - -
-

get_cursor_position(self, - locator) -

-
source code 
- -

Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers.

-

Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to -return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243.

-

This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element.

-

'locator' is an element locator pointing to an input element or textarea

-
-
-
-
- -
-
- - -
-

get_expression(self, - expression) -

-
source code 
- -

Returns the specified expression.

-

This is useful because of JavaScript preprocessing. -It is used to generate commands like assertExpression and waitForExpression.

-

'expression' is the value to return

-
-
-
-
- -
-
- - -
-

get_xpath_count(self, - xpath) -

-
source code 
- -

Returns the number of nodes that match the specified xpath, eg. "//table" would give -the number of tables.

-

'xpath' is the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you.

-
-
-
-
- -
-
- - -
-

assign_id(self, - locator, - identifier) -

-
source code 
- -

Temporarily sets the "id" attribute of the specified element, so you can locate it in the future -using its ID rather than a slow/complicated XPath. This ID will disappear once the page is -reloaded.

-

'locator' is an element locator pointing to an element -'identifier' is a string to be used as the ID of the specified element

-
-
-
-
- -
-
- - -
-

allow_native_xpath(self, - allow) -

-
source code 
- -

Specifies whether Selenium should use the native in-browser implementation -of XPath (if any native version is available); if you pass "false" to -this function, we will always use our pure-JavaScript xpath library. -Using the pure-JS xpath library can improve the consistency of xpath -element locators between different browser vendors, but the pure-JS -version is much slower than the native implementations.

-

'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath

-
-
-
-
- -
-
- - -
-

ignore_attributes_without_value(self, - ignore) -

-
source code 
- -

Specifies whether Selenium will ignore xpath attributes that have no -value, i.e. are the empty string, when using the non-native xpath -evaluation engine. You'd want to do this for performance reasons in IE. -However, this could break certain xpaths, for example an xpath that looks -for an attribute whose value is NOT the empty string.

-

The hope is that such xpaths are relatively rare, but the user should -have the option of using them. Note that this only influences xpath -evaluation when using the ajaxslt engine (i.e. not "javascript-xpath").

-

'ignore' is boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness.

-
-
-
-
- -
-
- - -
-

wait_for_condition(self, - script, - timeout) -

-
source code 
- -

Runs the specified JavaScript snippet repeatedly until it evaluates to "true". -The snippet may have multiple lines, but only the result of the last line -will be considered.

-

Note that, by default, the snippet will be run in the runner's test window, not in the window -of your application. To get the window of your application, you can use -the JavaScript snippet selenium.browserbot.getCurrentWindow(), and then -run your JavaScript in there

-

'script' is the JavaScript snippet to run -'timeout' is a timeout in milliseconds, after which this command will return with an error

-
-
-
-
- -
-
- - -
-

set_timeout(self, - timeout) -

-
source code 
- -

Specifies the amount of time that Selenium will wait for actions to complete.

-

Actions that require waiting include "open" and the "waitFor*" actions.

-

The default timeout is 30 seconds.

-

'timeout' is a timeout in milliseconds, after which the action will return with an error

-
-
-
-
- -
-
- - -
-

wait_for_page_to_load(self, - timeout) -

-
source code 
- -

Waits for a new page to load.

-

You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. -(which are only available in the JS API).

-

Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" -flag when it first notices a page load. Running any other Selenium command after -turns the flag to false. Hence, if you want to wait for a page to load, you must -wait immediately after a Selenium command that caused a page-load.

-

'timeout' is a timeout in milliseconds, after which this command will return with an error

-
-
-
-
- -
-
- - -
-

wait_for_frame_to_load(self, - frameAddress, - timeout) -

-
source code 
- -

Waits for a new frame to load.

-

Selenium constantly keeps track of new pages and frames loading, -and sets a "newPageLoaded" flag when it first notices a page load.

-

See waitForPageToLoad for more information.

-

'frameAddress' is FrameAddress from the server side -'timeout' is a timeout in milliseconds, after which this command will return with an error

-
-
-
-
- -
-
- - -
-

get_cookie(self) -

-
source code 
- - Return all cookies of the current page under test. -
-
-
-
- -
-
- - -
-

get_cookie_by_name(self, - name) -

-
source code 
- -

Returns the value of the cookie with the specified name, or throws an error if the cookie is not present.

-

'name' is the name of the cookie

-
-
-
-
- -
-
- - -
-

is_cookie_present(self, - name) -

-
source code 
- -

Returns true if a cookie with the specified name is present, or false otherwise.

-

'name' is the name of the cookie

-
-
-
-
- -
-
- - -
-

create_cookie(self, - nameValuePair, - optionsString) -

-
source code 
- -

Create a new cookie whose path and domain are same with those of current page -under test, unless you specified a path for this cookie explicitly.

-

'nameValuePair' is name and value of the cookie in a format "name=value" -'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail.

-
-
-
-
- -
-
- - -
-

delete_cookie(self, - name, - optionsString) -

-
source code 
- -

Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you -need to delete it using the exact same path and domain that were used to create the cookie. -If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also -note that specifying a domain that isn't a subset of the current domain will usually fail.

-

Since there's no way to discover at runtime the original path and domain of a given cookie, -we've added an option called 'recurse' to try all sub-domains of the current domain with -all paths that are a subset of the current path. Beware; this option can be slow. In -big-O notation, it operates in O(n*m) time, where n is the number of dots in the domain -name and m is the number of slashes in the path.

-

'name' is the name of the cookie to be deleted -'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail.

-
-
-
-
- -
-
- - -
-

delete_all_visible_cookies(self) -

-
source code 
- - Calls deleteCookie with recurse=true on all cookies visible to the current page. -As noted on the documentation for deleteCookie, recurse=true can be much slower -than simply deleting the cookies using a known domain/path. -
-
-
-
- -
-
- - -
-

set_browser_log_level(self, - logLevel) -

-
source code 
- -

Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. -Valid logLevel strings are: "debug", "info", "warn", "error" or "off". -To see the browser logs, you need to -either show the log window in GUI mode, or enable browser-side logging in Selenium RC.

-

'logLevel' is one of the following: "debug", "info", "warn", "error" or "off"

-
-
-
-
- -
-
- - -
-

run_script(self, - script) -

-
source code 
- -

Creates a new "script" tag in the body of the current test window, and -adds the specified text into the body of the command. Scripts run in -this way can often be debugged more easily than scripts executed using -Selenium's "getEval" command. Beware that JS exceptions thrown in these script -tags aren't managed by Selenium, so you should probably wrap your script -in try/catch blocks if there is any chance that the script will throw -an exception.

-

'script' is the JavaScript snippet to run

-
-
-
-
- -
-
- - -
-

add_location_strategy(self, - strategyName, - functionDefinition) -

-
source code 
- -

Defines a new function for Selenium to locate elements on the page. -For example, -if you define the strategy "foo", and someone runs click("foo=blah"), we'll -run your function, passing you the string "blah", and click on the element -that your function -returns, or throw an "Element not found" error if your function returns null.

-

We'll pass three arguments to your function:

-
    -
  • locator: the string the user passed in
  • -
  • inWindow: the currently selected window
  • -
  • inDocument: the currently selected document
  • -
-

The function must return null if the element can't be found.

-

'strategyName' is the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation. -'functionDefinition' is a string defining the body of a function in JavaScript. For example: return inDocument.getElementById(locator);

-
-
-
-
- -
-
- - -
-

capture_entire_page_screenshot(self, - filename, - kwargs) -

-
source code 
- -
-
-Saves the entire contents of the current window canvas to a PNG file.
-Contrast this with the captureScreenshot command, which captures the
-contents of the OS viewport (i.e. whatever is currently being displayed
-on the monitor), and is implemented in the RC only. Currently this only
-works in Firefox when running in chrome mode, and in IE non-HTA using
-the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly
-borrowed from the Screengrab! Firefox extension. Please see
-http://www.screengrab.org and http://snapsie.sourceforge.net/ for
-details.
-
-'filename' is the path to the file to persist the screenshot as. No                  filename extension will be appended by default.                  Directories will not be created if they do not exist,                    and an exception will be thrown, possibly by native                  code.
-'kwargs' is a kwargs string that modifies the way the screenshot                  is captured. Example: "background=#CCFFDD" .                  Currently valid options:                  
-*    background
-    the background CSS for the HTML document. This                     may be useful to set for capturing screenshots of                     less-than-ideal layouts, for example where absolute                     positioning causes the calculation of the canvas                     dimension to fail and a black background is exposed                     (possibly obscuring black text).
-
-
-
-
-
-
- -
-
- - -
-

rollup(self, - rollupName, - kwargs) -

-
source code 
- -

Executes a command rollup, which is a series of commands with a unique -name, and optionally arguments that control the generation of the set of -commands. If any one of the rolled-up commands fails, the rollup is -considered to have failed. Rollups may also contain nested rollups.

-

'rollupName' is the name of the rollup command -'kwargs' is keyword arguments string that influences how the rollup expands into commands

-
-
-
-
- -
-
- - -
-

add_script(self, - scriptContent, - scriptTagId) -

-
source code 
- -

Loads script content into a new script tag in the Selenium document. This -differs from the runScript command in that runScript adds the script tag -to the document of the AUT, not the Selenium document. The following -entities in the script content are replaced by the characters they -represent:

-
-&lt; -&gt; -&amp;
-

The corresponding remove command is removeScript.

-

'scriptContent' is the Javascript content of the script to add -'scriptTagId' is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail.

-
-
-
-
- -
-
- - -
-

remove_script(self, - scriptTagId) -

-
source code 
- -

Removes a script tag from the Selenium document identified by the given -id. Does nothing if the referenced tag doesn't exist.

-

'scriptTagId' is the id of the script element to remove.

-
-
-
-
- -
-
- - -
-

use_xpath_library(self, - libraryName) -

-
source code 
- -

Allows choice of one of the available libraries.

-

'libraryName' is name of the desired library Only the following three can be chosen: -* "ajaxslt" - Google's library -* "javascript-xpath" - Cybozu Labs' faster library -* "default" - The default library. Currently the default library is "ajaxslt" .

-
-If libraryName isn't one of these three, then no change will be made.
-
-
-
-
- -
-
- - -
-

set_context(self, - context) -

-
source code 
- -

Writes a message to the status bar and adds a note to the browser-side -log.

-

'context' is the message to be sent to the browser

-
-
-
-
- -
-
- - -
-

attach_file(self, - fieldLocator, - fileLocator) -

-
source code 
- -

Sets a file input (upload) field to the file listed in fileLocator

-

'fieldLocator' is an element locator -'fileLocator' is a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("*chrome") only.

-
-
-
-
- -
-
- - -
-

capture_screenshot(self, - filename) -

-
source code 
- -

Captures a PNG screenshot to the specified file.

-

'filename' is the absolute path to the file to be written, e.g. "c:lahscreenshot.png"

-
-
-
-
- -
-
- - -
-

capture_screenshot_to_string(self) -

-
source code 
- - Capture a PNG screenshot. It then returns the file as a base 64 encoded string. -
-
-
-
- -
-
- - -
-

captureNetworkTraffic(self, - type) -

-
source code 
- -

Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. When this function is called, the traffic log is cleared, so the returned content is only the traffic seen since the last call.

-

'type' is The type of data to return the network traffic as. Valid values are: json, xml, or plain.

-
-
-
-
- -
-
- - -
-

addCustomRequestHeader(self, - key, - value) -

-
source code 
- -

Tells the Selenium server to add the specificed key and value as a custom outgoing request header. This only works if the browser is configured to use the built in Selenium proxy.

-

'key' the header name. -'value' the header value.

-
-
-
-
- -
-
- - -
-

capture_entire_page_screenshot_to_string(self, - kwargs) -

-
source code 
- -

Downloads a screenshot of the browser current window canvas to a -based 64 encoded PNG file. The entire windows canvas is captured, -including parts rendered outside of the current view port.

-

Currently this only works in Mozilla and when running in chrome mode.

-

'kwargs' is A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).

-
-
-
-
- -
-
- - -
-

shut_down_selenium_server(self) -

-
source code 
- - Kills the running Selenium Server and all browser sessions. After you run this command, you will no longer be able to send -commands to the server; you can't remotely start the server once it has been stopped. Normally -you should prefer to run the "stop" command, which terminates the current browser session, rather than -shutting down the entire server. -
-
-
-
- -
-
- - -
-

retrieve_last_remote_control_logs(self) -

-
source code 
- - Retrieve the last messages logged on a specific remote control. Useful for error reports, especially -when running multiple remote controls in a distributed environment. The maximum number of log messages -that can be retrieve is configured on remote control startup. -
-
-
-
- -
-
- - -
-

key_down_native(self, - keycode) -

-
source code 
- -

Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. -This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -element, focus on the element first before running this command.

-

'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!

-
-
-
-
- -
-
- - -
-

key_up_native(self, - keycode) -

-
source code 
- -

Simulates a user releasing a key by sending a native operating system keystroke. -This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -element, focus on the element first before running this command.

-

'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!

-
-
-
-
- -
-
- - -
-

key_press_native(self, - keycode) -

-
source code 
- -

Simulates a user pressing and releasing a key by sending a native operating system keystroke. -This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing -a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and -metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular -element, focus on the element first before running this command.

-

'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!

-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-everything.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-everything.html deleted file mode 100644 index 57036fd36b..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-everything.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Everything - - - - - -

Everything

-
-

All Classes

-

- selenium.selenium


-[hide private] - - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-selenium-module.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-selenium-module.html deleted file mode 100644 index 0487e57348..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc-selenium-module.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - selenium - - - - - -

Module selenium

-
-

Classes

-

- selenium


-[hide private] - - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc.html deleted file mode 100644 index abe01e50a7..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/toc.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - Table of Contents - - - - - -

Table of Contents

-
-

- Everything -

-

Modules

-

- selenium


- [hide private] - - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/trees.html b/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/trees.html deleted file mode 100644 index 9db0d505b7..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/doc/trees.html +++ /dev/null @@ -1,108 +0,0 @@ - - - - - Trees - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  - - - - -
[hide private]
[frames] | no frames]
-
- -

Module Hierarchy

-
    -
  • selenium: Copyright 2006 ThoughtWorks, Inc.
  • -
- -

Class Hierarchy

- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium.py deleted file mode 100644 index 66fc45571b..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium.py +++ /dev/null @@ -1,2071 +0,0 @@ - -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" -__docformat__ = "restructuredtext en" - -# This file has been automatically generated via XSL - -import httplib -import urllib -import re - -class selenium: - """ - Defines an object that runs Selenium commands. - - Element Locators - ~~~~~~~~~~~~~~~~ - - Element Locators tell Selenium which HTML element a command refers to. - The format of a locator is: - - \ *locatorType*\ **=**\ \ *argument* - - - We support the following strategies for locating elements: - - - * \ **identifier**\ =\ *id*: - Select the element with the specified @id attribute. If no match is - found, select the first element whose @name attribute is \ *id*. - (This is normally the default; see below.) - * \ **id**\ =\ *id*: - Select the element with the specified @id attribute. - * \ **name**\ =\ *name*: - Select the first element with the specified @name attribute. - - * username - * name=username - - - The name may optionally be followed by one or more \ *element-filters*, separated from the name by whitespace. If the \ *filterType* is not specified, \ **value**\ is assumed. - - * name=flavour value=chocolate - - - * \ **dom**\ =\ *javascriptExpression*: - - Find an element by evaluating the specified string. This allows you to traverse the HTML Document Object - Model using JavaScript. Note that you must not return a value in this string; simply make it the last expression in the block. - - * dom=document.forms['myForm'].myDropdown - * dom=document.images[56] - * dom=function foo() { return document.links[1]; }; foo(); - - - * \ **xpath**\ =\ *xpathExpression*: - Locate an element using an XPath expression. - - * xpath=//img[@alt='The image alt text'] - * xpath=//table[@id='table1']//tr[4]/td[2] - * xpath=//a[contains(@href,'#id1')] - * xpath=//a[contains(@href,'#id1')]/@class - * xpath=(//table[@class='stylee'])//th[text()='theHeaderText']/../td - * xpath=//input[@name='name2' and @value='yes'] - * xpath=//\*[text()="right"] - - - * \ **link**\ =\ *textPattern*: - Select the link (anchor) element which contains text matching the - specified \ *pattern*. - - * link=The link text - - - * \ **css**\ =\ *cssSelectorSyntax*: - Select the element using css selectors. Please refer to CSS2 selectors, CSS3 selectors for more information. You can also check the TestCssLocators test in the selenium test suite for an example of usage, which is included in the downloaded selenium core package. - - * css=a[href="#id3"] - * css=span#firstChild + span - - - Currently the css selector locator supports all css1, css2 and css3 selectors except namespace in css3, some pseudo classes(:nth-of-type, :nth-last-of-type, :first-of-type, :last-of-type, :only-of-type, :visited, :hover, :active, :focus, :indeterminate) and pseudo elements(::first-line, ::first-letter, ::selection, ::before, ::after). - - * \ **ui**\ =\ *uiSpecifierString*: - Locate an element by resolving the UI specifier string to another locator, and evaluating it. See the Selenium UI-Element Reference for more details. - - * ui=loginPages::loginButton() - * ui=settingsPages::toggle(label=Hide Email) - * ui=forumPages::postBody(index=2)//a[2] - - - - - - Without an explicit locator prefix, Selenium uses the following default - strategies: - - - * \ **dom**\ , for locators starting with "document." - * \ **xpath**\ , for locators starting with "//" - * \ **identifier**\ , otherwise - - Element Filters - ~~~~~~~~~~~~~~~ - - Element filters can be used with a locator to refine a list of candidate elements. They are currently used only in the 'name' element-locator. - - Filters look much like locators, ie. - - \ *filterType*\ **=**\ \ *argument* - - Supported element-filters are: - - \ **value=**\ \ *valuePattern* - - - Matches elements based on their values. This is particularly useful for refining a list of similarly-named toggle-buttons. - - \ **index=**\ \ *index* - - - Selects a single element based on its position in the list (offset from zero). - - String-match Patterns - ~~~~~~~~~~~~~~~~~~~~~ - - Various Pattern syntaxes are available for matching string values: - - - * \ **glob:**\ \ *pattern*: - Match a string against a "glob" (aka "wildmat") pattern. "Glob" is a - kind of limited regular-expression syntax typically used in command-line - shells. In a glob pattern, "\*" represents any sequence of characters, and "?" - represents any single character. Glob patterns match against the entire - string. - * \ **regexp:**\ \ *regexp*: - Match a string using a regular-expression. The full power of JavaScript - regular-expressions is available. - * \ **regexpi:**\ \ *regexpi*: - Match a string using a case-insensitive regular-expression. - * \ **exact:**\ \ *string*: - - Match a string exactly, verbatim, without any of that fancy wildcard - stuff. - - - - If no pattern prefix is specified, Selenium assumes that it's a "glob" - pattern. - - - - For commands that return multiple values (such as verifySelectOptions), - the string being matched is a comma-separated list of the return values, - where both commas and backslashes in the values are backslash-escaped. - When providing a pattern, the optional matching syntax (i.e. glob, - regexp, etc.) is specified once, as usual, at the beginning of the - pattern. - - - """ - -### This part is hard-coded in the XSL - def __init__(self, host, port, browserStartCommand, browserURL): - self.host = host - self.port = port - self.browserStartCommand = browserStartCommand - self.browserURL = browserURL - self.sessionId = None - self.extensionJs = "" - - def setExtensionJs(self, extensionJs): - self.extensionJs = extensionJs - - def start(self): - result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL, self.extensionJs]) - try: - self.sessionId = result - except ValueError: - raise Exception, result - - def stop(self): - self.do_command("testComplete", []) - self.sessionId = None - - def do_command(self, verb, args): - conn = httplib.HTTPConnection(self.host, self.port) - body = u'cmd=' + urllib.quote_plus(unicode(verb).encode('utf-8')) - for i in range(len(args)): - body += '&' + unicode(i+1) + '=' + urllib.quote_plus(unicode(args[i]).encode('utf-8')) - if (None != self.sessionId): - body += "&sessionId=" + unicode(self.sessionId) - headers = {"Content-Type": "application/x-www-form-urlencoded; charset=utf-8"} - conn.request("POST", "/selenium-server/driver/", body, headers) - - response = conn.getresponse() - #print response.status, response.reason - data = unicode(response.read(), "UTF-8") - result = response.reason - #print "Selenium Result: " + repr(data) + "\n\n" - if (not data.startswith('OK')): - raise Exception, data - return data - - def get_string(self, verb, args): - result = self.do_command(verb, args) - return result[3:] - - def get_string_array(self, verb, args): - csv = self.get_string(verb, args) - token = "" - tokens = [] - escape = False - for i in range(len(csv)): - letter = csv[i] - if (escape): - token = token + letter - escape = False - continue - if (letter == '\\'): - escape = True - elif (letter == ','): - tokens.append(token) - token = "" - else: - token = token + letter - tokens.append(token) - return tokens - - def get_number(self, verb, args): - # Is there something I need to do here? - return self.get_string(verb, args) - - def get_number_array(self, verb, args): - # Is there something I need to do here? - return self.get_string_array(verb, args) - - def get_boolean(self, verb, args): - boolstr = self.get_string(verb, args) - if ("true" == boolstr): - return True - if ("false" == boolstr): - return False - raise ValueError, "result is neither 'true' nor 'false': " + boolstr - - def get_boolean_array(self, verb, args): - boolarr = self.get_string_array(verb, args) - for i in range(len(boolarr)): - if ("true" == boolstr): - boolarr[i] = True - continue - if ("false" == boolstr): - boolarr[i] = False - continue - raise ValueError, "result is neither 'true' nor 'false': " + boolarr[i] - return boolarr - - - -### From here on, everything's auto-generated from XML - - - def click(self,locator): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("click", [locator,]) - - - def double_click(self,locator): - """ - Double clicks on a link, button, checkbox or radio button. If the double click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - """ - self.do_command("doubleClick", [locator,]) - - - def context_menu(self,locator): - """ - Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - - 'locator' is an element locator - """ - self.do_command("contextMenu", [locator,]) - - - def click_at(self,locator,coordString): - """ - Clicks on a link, button, checkbox or radio button. If the click action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("clickAt", [locator,coordString,]) - - - def double_click_at(self,locator,coordString): - """ - Doubleclicks on a link, button, checkbox or radio button. If the action - causes a new page to load (like a link usually does), call - waitForPageToLoad. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("doubleClickAt", [locator,coordString,]) - - - def context_menu_at(self,locator,coordString): - """ - Simulates opening the context menu for the specified element (as might happen if the user "right-clicked" on the element). - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("contextMenuAt", [locator,coordString,]) - - - def fire_event(self,locator,eventName): - """ - Explicitly simulate an event, to trigger the corresponding "on\ *event*" - handler. - - 'locator' is an element locator - 'eventName' is the event name, e.g. "focus" or "blur" - """ - self.do_command("fireEvent", [locator,eventName,]) - - - def focus(self,locator): - """ - Move the focus to the specified element; for example, if the element is an input field, move the cursor to that field. - - 'locator' is an element locator - """ - self.do_command("focus", [locator,]) - - - def key_press(self,locator,keySequence): - """ - Simulates a user pressing and releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyPress", [locator,keySequence,]) - - - def shift_key_down(self): - """ - Press the shift key and hold it down until doShiftUp() is called or a new page is loaded. - - """ - self.do_command("shiftKeyDown", []) - - - def shift_key_up(self): - """ - Release the shift key. - - """ - self.do_command("shiftKeyUp", []) - - - def meta_key_down(self): - """ - Press the meta key and hold it down until doMetaUp() is called or a new page is loaded. - - """ - self.do_command("metaKeyDown", []) - - - def meta_key_up(self): - """ - Release the meta key. - - """ - self.do_command("metaKeyUp", []) - - - def alt_key_down(self): - """ - Press the alt key and hold it down until doAltUp() is called or a new page is loaded. - - """ - self.do_command("altKeyDown", []) - - - def alt_key_up(self): - """ - Release the alt key. - - """ - self.do_command("altKeyUp", []) - - - def control_key_down(self): - """ - Press the control key and hold it down until doControlUp() is called or a new page is loaded. - - """ - self.do_command("controlKeyDown", []) - - - def control_key_up(self): - """ - Release the control key. - - """ - self.do_command("controlKeyUp", []) - - - def key_down(self,locator,keySequence): - """ - Simulates a user pressing a key (without releasing it yet). - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyDown", [locator,keySequence,]) - - - def key_up(self,locator,keySequence): - """ - Simulates a user releasing a key. - - 'locator' is an element locator - 'keySequence' is Either be a string("\" followed by the numeric keycode of the key to be pressed, normally the ASCII value of that key), or a single character. For example: "w", "\119". - """ - self.do_command("keyUp", [locator,keySequence,]) - - - def mouse_over(self,locator): - """ - Simulates a user hovering a mouse over the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOver", [locator,]) - - - def mouse_out(self,locator): - """ - Simulates a user moving the mouse pointer away from the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseOut", [locator,]) - - - def mouse_down(self,locator): - """ - Simulates a user pressing the left mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseDown", [locator,]) - - - def mouse_down_right(self,locator): - """ - Simulates a user pressing the right mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseDownRight", [locator,]) - - - def mouse_down_at(self,locator,coordString): - """ - Simulates a user pressing the left mouse button (without releasing it yet) at - the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseDownAt", [locator,coordString,]) - - - def mouse_down_right_at(self,locator,coordString): - """ - Simulates a user pressing the right mouse button (without releasing it yet) at - the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseDownRightAt", [locator,coordString,]) - - - def mouse_up(self,locator): - """ - Simulates the event that occurs when the user releases the mouse button (i.e., stops - holding the button down) on the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseUp", [locator,]) - - - def mouse_up_right(self,locator): - """ - Simulates the event that occurs when the user releases the right mouse button (i.e., stops - holding the button down) on the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseUpRight", [locator,]) - - - def mouse_up_at(self,locator,coordString): - """ - Simulates the event that occurs when the user releases the mouse button (i.e., stops - holding the button down) at the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseUpAt", [locator,coordString,]) - - - def mouse_up_right_at(self,locator,coordString): - """ - Simulates the event that occurs when the user releases the right mouse button (i.e., stops - holding the button down) at the specified location. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseUpRightAt", [locator,coordString,]) - - - def mouse_move(self,locator): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - """ - self.do_command("mouseMove", [locator,]) - - - def mouse_move_at(self,locator,coordString): - """ - Simulates a user pressing the mouse button (without releasing it yet) on - the specified element. - - 'locator' is an element locator - 'coordString' is specifies the x,y position (i.e. - 10,20) of the mouse event relative to the element returned by the locator. - """ - self.do_command("mouseMoveAt", [locator,coordString,]) - - - def type(self,locator,value): - """ - Sets the value of an input field, as though you typed it in. - - - Can also be used to set the value of combo boxes, check boxes, etc. In these cases, - value should be the value of the option selected, not the visible text. - - - 'locator' is an element locator - 'value' is the value to type - """ - self.do_command("type", [locator,value,]) - - - def type_keys(self,locator,value): - """ - Simulates keystroke events on the specified element, as though you typed the value key-by-key. - - - This is a convenience method for calling keyDown, keyUp, keyPress for every character in the specified string; - this is useful for dynamic UI widgets (like auto-completing combo boxes) that require explicit key events. - - Unlike the simple "type" command, which forces the specified value into the page directly, this command - may or may not have any visible effect, even in cases where typing keys would normally have a visible effect. - For example, if you use "typeKeys" on a form element, you may or may not see the results of what you typed in - the field. - - In some cases, you may need to use the simple "type" command to set the value of the field and then the "typeKeys" command to - send the keystroke events corresponding to what you just typed. - - - 'locator' is an element locator - 'value' is the value to type - """ - self.do_command("typeKeys", [locator,value,]) - - - def set_speed(self,value): - """ - Set execution speed (i.e., set the millisecond length of a delay which will follow each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - 'value' is the number of milliseconds to pause after operation - """ - self.do_command("setSpeed", [value,]) - - - def get_speed(self): - """ - Get execution speed (i.e., get the millisecond length of the delay following each selenium operation). By default, there is no such delay, i.e., - the delay is 0 milliseconds. - - See also setSpeed. - - """ - return self.get_string("getSpeed", []) - - - def check(self,locator): - """ - Check a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("check", [locator,]) - - - def uncheck(self,locator): - """ - Uncheck a toggle-button (checkbox/radio) - - 'locator' is an element locator - """ - self.do_command("uncheck", [locator,]) - - - def select(self,selectLocator,optionLocator): - """ - Select an option from a drop-down using an option locator. - - - - Option locators provide different ways of specifying options of an HTML - Select element (e.g. for selecting a specific option, or for asserting - that the selected option satisfies a specification). There are several - forms of Select Option Locator. - - - * \ **label**\ =\ *labelPattern*: - matches options based on their labels, i.e. the visible text. (This - is the default.) - - * label=regexp:^[Oo]ther - - - * \ **value**\ =\ *valuePattern*: - matches options based on their values. - - * value=other - - - * \ **id**\ =\ *id*: - - matches options based on their ids. - - * id=option1 - - - * \ **index**\ =\ *index*: - matches an option based on its index (offset from zero). - - * index=2 - - - - - - If no option locator prefix is provided, the default behaviour is to match on \ **label**\ . - - - - 'selectLocator' is an element locator identifying a drop-down menu - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("select", [selectLocator,optionLocator,]) - - - def add_selection(self,locator,optionLocator): - """ - Add a selection to the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("addSelection", [locator,optionLocator,]) - - - def remove_selection(self,locator,optionLocator): - """ - Remove a selection from the set of selected options in a multi-select element using an option locator. - - @see #doSelect for details of option locators - - 'locator' is an element locator identifying a multi-select box - 'optionLocator' is an option locator (a label by default) - """ - self.do_command("removeSelection", [locator,optionLocator,]) - - - def remove_all_selections(self,locator): - """ - Unselects all of the selected options in a multi-select element. - - 'locator' is an element locator identifying a multi-select box - """ - self.do_command("removeAllSelections", [locator,]) - - - def submit(self,formLocator): - """ - Submit the specified form. This is particularly useful for forms without - submit buttons, e.g. single-input "Search" forms. - - 'formLocator' is an element locator for the form you want to submit - """ - self.do_command("submit", [formLocator,]) - - - def open(self,url): - """ - Opens an URL in the test frame. This accepts both relative and absolute - URLs. - - The "open" command waits for the page to load before proceeding, - ie. the "AndWait" suffix is implicit. - - \ *Note*: The URL must be on the same domain as the runner HTML - due to security restrictions in the browser (Same Origin Policy). If you - need to open an URL on another domain, use the Selenium Server to start a - new browser session on that domain. - - 'url' is the URL to open; may be relative or absolute - """ - self.do_command("open", [url,]) - - - def open_window(self,url,windowID): - """ - Opens a popup window (if a window with that ID isn't already open). - After opening the window, you'll need to select it using the selectWindow - command. - - - This command can also be a useful workaround for bug SEL-339. In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'url' is the URL to open, which can be blank - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("openWindow", [url,windowID,]) - - - def select_window(self,windowID): - """ - Selects a popup window using a window locator; once a popup window has been selected, all - commands go to that window. To select the main window again, use null - as the target. - - - - - Window locators provide different ways of specifying the window object: - by title, by internal JavaScript "name," or by JavaScript variable. - - - * \ **title**\ =\ *My Special Window*: - Finds the window using the text that appears in the title bar. Be careful; - two windows can share the same title. If that happens, this locator will - just pick one. - - * \ **name**\ =\ *myWindow*: - Finds the window using its internal JavaScript "name" property. This is the second - parameter "windowName" passed to the JavaScript method window.open(url, windowName, windowFeatures, replaceFlag) - (which Selenium intercepts). - - * \ **var**\ =\ *variableName*: - Some pop-up windows are unnamed (anonymous), but are associated with a JavaScript variable name in the current - application window, e.g. "window.foo = window.open(url);". In those cases, you can open the window using - "var=foo". - - - - - If no window locator prefix is provided, we'll try to guess what you mean like this: - - 1.) if windowID is null, (or the string "null") then it is assumed the user is referring to the original window instantiated by the browser). - - 2.) if the value of the "windowID" parameter is a JavaScript variable name in the current application window, then it is assumed - that this variable contains the return value from a call to the JavaScript window.open() method. - - 3.) Otherwise, selenium looks in a hash it maintains that maps string names to window "names". - - 4.) If \ *that* fails, we'll try looping over all of the known windows to try to find the appropriate "title". - Since "title" is not necessarily unique, this may have unexpected behavior. - - If you're having trouble figuring out the name of a window that you want to manipulate, look at the Selenium log messages - which identify the names of windows created via window.open (and therefore intercepted by Selenium). You will see messages - like the following for each window as it is opened: - - ``debug: window.open call intercepted; window ID (which you can use with selectWindow()) is "myNewWindow"`` - - In some cases, Selenium will be unable to intercept a call to window.open (if the call occurs during or before the "onLoad" event, for example). - (This is bug SEL-339.) In those cases, you can force Selenium to notice the open window's name by using the Selenium openWindow command, using - an empty (blank) url, like this: openWindow("", "myFunnyWindow"). - - - 'windowID' is the JavaScript window ID of the window to select - """ - self.do_command("selectWindow", [windowID,]) - - - def select_pop_up(self,windowID): - """ - Simplifies the process of selecting a popup window (and does not offer - functionality beyond what ``selectWindow()`` already provides). - - * If ``windowID`` is either not specified, or specified as - "null", the first non-top window is selected. The top window is the one - that would be selected by ``selectWindow()`` without providing a - ``windowID`` . This should not be used when more than one popup - window is in play. - * Otherwise, the window will be looked up considering - ``windowID`` as the following in order: 1) the "name" of the - window, as specified to ``window.open()``; 2) a javascript - variable which is a reference to a window; and 3) the title of the - window. This is the same ordered lookup performed by - ``selectWindow`` . - - - - 'windowID' is an identifier for the popup window, which can take on a number of different meanings - """ - self.do_command("selectPopUp", [windowID,]) - - - def deselect_pop_up(self): - """ - Selects the main window. Functionally equivalent to using - ``selectWindow()`` and specifying no value for - ``windowID``. - - """ - self.do_command("deselectPopUp", []) - - - def select_frame(self,locator): - """ - Selects a frame within the current window. (You may invoke this command - multiple times to select nested frames.) To select the parent frame, use - "relative=parent" as a locator; to select the top frame, use "relative=top". - You can also select a frame by its 0-based index number; select the first frame with - "index=0", or the third frame with "index=2". - - - You may also use a DOM expression to identify the frame you want directly, - like this: ``dom=frames["main"].frames["subframe"]`` - - - 'locator' is an element locator identifying a frame or iframe - """ - self.do_command("selectFrame", [locator,]) - - - def get_whether_this_frame_match_frame_expression(self,currentFrameString,target): - """ - Determine whether current/locator identify the frame containing this running code. - - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" frame. In this case, when the test calls selectFrame, this - routine is called for each frame to figure out which one has been selected. - The selected frame will return true, while all others will return false. - - - 'currentFrameString' is starting frame - 'target' is new frame (which might be relative to the current one) - """ - return self.get_boolean("getWhetherThisFrameMatchFrameExpression", [currentFrameString,target,]) - - - def get_whether_this_window_match_window_expression(self,currentWindowString,target): - """ - Determine whether currentWindowString plus target identify the window containing this running code. - - - This is useful in proxy injection mode, where this code runs in every - browser frame and window, and sometimes the selenium server needs to identify - the "current" window. In this case, when the test calls selectWindow, this - routine is called for each window to figure out which one has been selected. - The selected window will return true, while all others will return false. - - - 'currentWindowString' is starting window - 'target' is new window (which might be relative to the current one, e.g., "_parent") - """ - return self.get_boolean("getWhetherThisWindowMatchWindowExpression", [currentWindowString,target,]) - - - def wait_for_pop_up(self,windowID,timeout): - """ - Waits for a popup window to appear and load up. - - 'windowID' is the JavaScript window "name" of the window that will appear (not the text of the title bar) If unspecified, or specified as "null", this command will wait for the first non-top window to appear (don't rely on this if you are working with multiple popups simultaneously). - 'timeout' is a timeout in milliseconds, after which the action will return with an error. If this value is not specified, the default Selenium timeout will be used. See the setTimeout() command. - """ - self.do_command("waitForPopUp", [windowID,timeout,]) - - - def choose_cancel_on_next_confirmation(self): - """ - - - By default, Selenium's overridden window.confirm() function will - return true, as if the user had manually clicked OK; after running - this command, the next call to confirm() will return false, as if - the user had clicked Cancel. Selenium will then resume using the - default behavior for future confirmations, automatically returning - true (OK) unless/until you explicitly call this command for each - confirmation. - - - - Take note - every time a confirmation comes up, you must - consume it with a corresponding getConfirmation, or else - the next selenium operation will fail. - - - - """ - self.do_command("chooseCancelOnNextConfirmation", []) - - - def choose_ok_on_next_confirmation(self): - """ - - - Undo the effect of calling chooseCancelOnNextConfirmation. Note - that Selenium's overridden window.confirm() function will normally automatically - return true, as if the user had manually clicked OK, so you shouldn't - need to use this command unless for some reason you need to change - your mind prior to the next confirmation. After any confirmation, Selenium will resume using the - default behavior for future confirmations, automatically returning - true (OK) unless/until you explicitly call chooseCancelOnNextConfirmation for each - confirmation. - - - - Take note - every time a confirmation comes up, you must - consume it with a corresponding getConfirmation, or else - the next selenium operation will fail. - - - - """ - self.do_command("chooseOkOnNextConfirmation", []) - - - def answer_on_next_prompt(self,answer): - """ - Instructs Selenium to return the specified answer string in response to - the next JavaScript prompt [window.prompt()]. - - 'answer' is the answer to give in response to the prompt pop-up - """ - self.do_command("answerOnNextPrompt", [answer,]) - - - def go_back(self): - """ - Simulates the user clicking the "back" button on their browser. - - """ - self.do_command("goBack", []) - - - def refresh(self): - """ - Simulates the user clicking the "Refresh" button on their browser. - - """ - self.do_command("refresh", []) - - - def close(self): - """ - Simulates the user clicking the "close" button in the titlebar of a popup - window or tab. - - """ - self.do_command("close", []) - - - def is_alert_present(self): - """ - Has an alert occurred? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isAlertPresent", []) - - - def is_prompt_present(self): - """ - Has a prompt occurred? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isPromptPresent", []) - - - def is_confirmation_present(self): - """ - Has confirm() been called? - - - - This function never throws an exception - - - - """ - return self.get_boolean("isConfirmationPresent", []) - - - def get_alert(self): - """ - Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. - - - Getting an alert has the same effect as manually clicking OK. If an - alert is generated but you do not consume it with getAlert, the next Selenium action - will fail. - - Under Selenium, JavaScript alerts will NOT pop up a visible alert - dialog. - - Selenium does NOT support JavaScript alerts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getAlert", []) - - - def get_confirmation(self): - """ - Retrieves the message of a JavaScript confirmation dialog generated during - the previous action. - - - - By default, the confirm function will return true, having the same effect - as manually clicking OK. This can be changed by prior execution of the - chooseCancelOnNextConfirmation command. - - - - If an confirmation is generated but you do not consume it with getConfirmation, - the next Selenium action will fail. - - - - NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible - dialog. - - - - NOTE: Selenium does NOT support JavaScript confirmations that are - generated in a page's onload() event handler. In this case a visible - dialog WILL be generated and Selenium will hang until you manually click - OK. - - - - """ - return self.get_string("getConfirmation", []) - - - def get_prompt(self): - """ - Retrieves the message of a JavaScript question prompt dialog generated during - the previous action. - - - Successful handling of the prompt requires prior execution of the - answerOnNextPrompt command. If a prompt is generated but you - do not get/verify it, the next Selenium action will fail. - - NOTE: under Selenium, JavaScript prompts will NOT pop up a visible - dialog. - - NOTE: Selenium does NOT support JavaScript prompts that are generated in a - page's onload() event handler. In this case a visible dialog WILL be - generated and Selenium will hang until someone manually clicks OK. - - - """ - return self.get_string("getPrompt", []) - - - def get_location(self): - """ - Gets the absolute URL of the current page. - - """ - return self.get_string("getLocation", []) - - - def get_title(self): - """ - Gets the title of the current page. - - """ - return self.get_string("getTitle", []) - - - def get_body_text(self): - """ - Gets the entire text of the page. - - """ - return self.get_string("getBodyText", []) - - - def get_value(self,locator): - """ - Gets the (whitespace-trimmed) value of an input field (or anything else with a value parameter). - For checkbox/radio elements, the value will be "on" or "off" depending on - whether the element is checked or not. - - 'locator' is an element locator - """ - return self.get_string("getValue", [locator,]) - - - def get_text(self,locator): - """ - Gets the text of an element. This works for any element that contains - text. This command uses either the textContent (Mozilla-like browsers) or - the innerText (IE-like browsers) of the element, which is the rendered - text shown to the user. - - 'locator' is an element locator - """ - return self.get_string("getText", [locator,]) - - - def highlight(self,locator): - """ - Briefly changes the backgroundColor of the specified element yellow. Useful for debugging. - - 'locator' is an element locator - """ - self.do_command("highlight", [locator,]) - - - def get_eval(self,script): - """ - Gets the result of evaluating the specified JavaScript snippet. The snippet may - have multiple lines, but only the result of the last line will be returned. - - - Note that, by default, the snippet will run in the context of the "selenium" - object itself, so ``this`` will refer to the Selenium object. Use ``window`` to - refer to the window of your application, e.g. ``window.document.getElementById('foo')`` - - If you need to use - a locator to refer to a single element in your application page, you can - use ``this.browserbot.findElement("id=foo")`` where "id=foo" is your locator. - - - 'script' is the JavaScript snippet to run - """ - return self.get_string("getEval", [script,]) - - - def is_checked(self,locator): - """ - Gets whether a toggle-button (checkbox/radio) is checked. Fails if the specified element doesn't exist or isn't a toggle-button. - - 'locator' is an element locator pointing to a checkbox or radio button - """ - return self.get_boolean("isChecked", [locator,]) - - - def get_table(self,tableCellAddress): - """ - Gets the text from a cell of a table. The cellAddress syntax - tableLocator.row.column, where row and column start at 0. - - 'tableCellAddress' is a cell address, e.g. "foo.1.4" - """ - return self.get_string("getTable", [tableCellAddress,]) - - - def get_selected_labels(self,selectLocator): - """ - Gets all option labels (visible text) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedLabels", [selectLocator,]) - - - def get_selected_label(self,selectLocator): - """ - Gets option label (visible text) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedLabel", [selectLocator,]) - - - def get_selected_values(self,selectLocator): - """ - Gets all option values (value attributes) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedValues", [selectLocator,]) - - - def get_selected_value(self,selectLocator): - """ - Gets option value (value attribute) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedValue", [selectLocator,]) - - - def get_selected_indexes(self,selectLocator): - """ - Gets all option indexes (option number, starting at 0) for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIndexes", [selectLocator,]) - - - def get_selected_index(self,selectLocator): - """ - Gets option index (option number, starting at 0) for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedIndex", [selectLocator,]) - - - def get_selected_ids(self,selectLocator): - """ - Gets all option element IDs for selected options in the specified select or multi-select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectedIds", [selectLocator,]) - - - def get_selected_id(self,selectLocator): - """ - Gets option element ID for selected option in the specified select element. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string("getSelectedId", [selectLocator,]) - - - def is_something_selected(self,selectLocator): - """ - Determines whether some option in a drop-down menu is selected. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_boolean("isSomethingSelected", [selectLocator,]) - - - def get_select_options(self,selectLocator): - """ - Gets all option labels in the specified select drop-down. - - 'selectLocator' is an element locator identifying a drop-down menu - """ - return self.get_string_array("getSelectOptions", [selectLocator,]) - - - def get_attribute(self,attributeLocator): - """ - Gets the value of an element attribute. The value of the attribute may - differ across browsers (this is the case for the "style" attribute, for - example). - - 'attributeLocator' is an element locator followed by an @ sign and then the name of the attribute, e.g. "foo@bar" - """ - return self.get_string("getAttribute", [attributeLocator,]) - - - def is_text_present(self,pattern): - """ - Verifies that the specified text pattern appears somewhere on the rendered page shown to the user. - - 'pattern' is a pattern to match with the text of the page - """ - return self.get_boolean("isTextPresent", [pattern,]) - - - def is_element_present(self,locator): - """ - Verifies that the specified element is somewhere on the page. - - 'locator' is an element locator - """ - return self.get_boolean("isElementPresent", [locator,]) - - - def is_visible(self,locator): - """ - Determines if the specified element is visible. An - element can be rendered invisible by setting the CSS "visibility" - property to "hidden", or the "display" property to "none", either for the - element itself or one if its ancestors. This method will fail if - the element is not present. - - 'locator' is an element locator - """ - return self.get_boolean("isVisible", [locator,]) - - - def is_editable(self,locator): - """ - Determines whether the specified input element is editable, ie hasn't been disabled. - This method will fail if the specified element isn't an input element. - - 'locator' is an element locator - """ - return self.get_boolean("isEditable", [locator,]) - - - def get_all_buttons(self): - """ - Returns the IDs of all buttons on the page. - - - If a given button has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllButtons", []) - - - def get_all_links(self): - """ - Returns the IDs of all links on the page. - - - If a given link has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllLinks", []) - - - def get_all_fields(self): - """ - Returns the IDs of all input fields on the page. - - - If a given field has no ID, it will appear as "" in this array. - - - """ - return self.get_string_array("getAllFields", []) - - - def get_attribute_from_all_windows(self,attributeName): - """ - Returns every instance of some attribute from all known windows. - - 'attributeName' is name of an attribute on the windows - """ - return self.get_string_array("getAttributeFromAllWindows", [attributeName,]) - - - def dragdrop(self,locator,movementsString): - """ - deprecated - use dragAndDrop instead - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragdrop", [locator,movementsString,]) - - - def set_mouse_speed(self,pixels): - """ - Configure the number of pixels between "mousemove" events during dragAndDrop commands (default=10). - - Setting this value to 0 means that we'll send a "mousemove" event to every single pixel - in between the start location and the end location; that can be very slow, and may - cause some browsers to force the JavaScript to timeout. - - If the mouse speed is greater than the distance between the two dragged objects, we'll - just send one "mousemove" at the start location and then one final one at the end location. - - - 'pixels' is the number of pixels between "mousemove" events - """ - self.do_command("setMouseSpeed", [pixels,]) - - - def get_mouse_speed(self): - """ - Returns the number of pixels between "mousemove" events during dragAndDrop commands (default=10). - - """ - return self.get_number("getMouseSpeed", []) - - - def drag_and_drop(self,locator,movementsString): - """ - Drags an element a certain distance and then drops it - - 'locator' is an element locator - 'movementsString' is offset in pixels from the current location to which the element should be moved, e.g., "+70,-300" - """ - self.do_command("dragAndDrop", [locator,movementsString,]) - - - def drag_and_drop_to_object(self,locatorOfObjectToBeDragged,locatorOfDragDestinationObject): - """ - Drags an element and drops it on another element - - 'locatorOfObjectToBeDragged' is an element to be dragged - 'locatorOfDragDestinationObject' is an element whose location (i.e., whose center-most pixel) will be the point where locatorOfObjectToBeDragged is dropped - """ - self.do_command("dragAndDropToObject", [locatorOfObjectToBeDragged,locatorOfDragDestinationObject,]) - - - def window_focus(self): - """ - Gives focus to the currently selected window - - """ - self.do_command("windowFocus", []) - - - def window_maximize(self): - """ - Resize currently selected window to take up the entire screen - - """ - self.do_command("windowMaximize", []) - - - def get_all_window_ids(self): - """ - Returns the IDs of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowIds", []) - - - def get_all_window_names(self): - """ - Returns the names of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowNames", []) - - - def get_all_window_titles(self): - """ - Returns the titles of all windows that the browser knows about. - - """ - return self.get_string_array("getAllWindowTitles", []) - - - def get_html_source(self): - """ - Returns the entire HTML source between the opening and - closing "html" tags. - - """ - return self.get_string("getHtmlSource", []) - - - def set_cursor_position(self,locator,position): - """ - Moves the text cursor to the specified position in the given input element or textarea. - This method will fail if the specified element isn't an input element or textarea. - - 'locator' is an element locator pointing to an input element or textarea - 'position' is the numerical position of the cursor in the field; position should be 0 to move the position to the beginning of the field. You can also set the cursor to -1 to move it to the end of the field. - """ - self.do_command("setCursorPosition", [locator,position,]) - - - def get_element_index(self,locator): - """ - Get the relative index of an element to its parent (starting from 0). The comment node and empty text node - will be ignored. - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementIndex", [locator,]) - - - def is_ordered(self,locator1,locator2): - """ - Check if these two elements have same parent and are ordered siblings in the DOM. Two same elements will - not be considered ordered. - - 'locator1' is an element locator pointing to the first element - 'locator2' is an element locator pointing to the second element - """ - return self.get_boolean("isOrdered", [locator1,locator2,]) - - - def get_element_position_left(self,locator): - """ - Retrieves the horizontal position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionLeft", [locator,]) - - - def get_element_position_top(self,locator): - """ - Retrieves the vertical position of an element - - 'locator' is an element locator pointing to an element OR an element itself - """ - return self.get_number("getElementPositionTop", [locator,]) - - - def get_element_width(self,locator): - """ - Retrieves the width of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementWidth", [locator,]) - - - def get_element_height(self,locator): - """ - Retrieves the height of an element - - 'locator' is an element locator pointing to an element - """ - return self.get_number("getElementHeight", [locator,]) - - - def get_cursor_position(self,locator): - """ - Retrieves the text cursor position in the given input element or textarea; beware, this may not work perfectly on all browsers. - - - Specifically, if the cursor/selection has been cleared by JavaScript, this command will tend to - return the position of the last location of the cursor, even though the cursor is now gone from the page. This is filed as SEL-243. - - This method will fail if the specified element isn't an input element or textarea, or there is no cursor in the element. - - 'locator' is an element locator pointing to an input element or textarea - """ - return self.get_number("getCursorPosition", [locator,]) - - - def get_expression(self,expression): - """ - Returns the specified expression. - - - This is useful because of JavaScript preprocessing. - It is used to generate commands like assertExpression and waitForExpression. - - - 'expression' is the value to return - """ - return self.get_string("getExpression", [expression,]) - - - def get_xpath_count(self,xpath): - """ - Returns the number of nodes that match the specified xpath, eg. "//table" would give - the number of tables. - - 'xpath' is the xpath expression to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you. - """ - return self.get_number("getXpathCount", [xpath,]) - - - def assign_id(self,locator,identifier): - """ - Temporarily sets the "id" attribute of the specified element, so you can locate it in the future - using its ID rather than a slow/complicated XPath. This ID will disappear once the page is - reloaded. - - 'locator' is an element locator pointing to an element - 'identifier' is a string to be used as the ID of the specified element - """ - self.do_command("assignId", [locator,identifier,]) - - - def allow_native_xpath(self,allow): - """ - Specifies whether Selenium should use the native in-browser implementation - of XPath (if any native version is available); if you pass "false" to - this function, we will always use our pure-JavaScript xpath library. - Using the pure-JS xpath library can improve the consistency of xpath - element locators between different browser vendors, but the pure-JS - version is much slower than the native implementations. - - 'allow' is boolean, true means we'll prefer to use native XPath; false means we'll only use JS XPath - """ - self.do_command("allowNativeXpath", [allow,]) - - - def ignore_attributes_without_value(self,ignore): - """ - Specifies whether Selenium will ignore xpath attributes that have no - value, i.e. are the empty string, when using the non-native xpath - evaluation engine. You'd want to do this for performance reasons in IE. - However, this could break certain xpaths, for example an xpath that looks - for an attribute whose value is NOT the empty string. - - The hope is that such xpaths are relatively rare, but the user should - have the option of using them. Note that this only influences xpath - evaluation when using the ajaxslt engine (i.e. not "javascript-xpath"). - - 'ignore' is boolean, true means we'll ignore attributes without value at the expense of xpath "correctness"; false means we'll sacrifice speed for correctness. - """ - self.do_command("ignoreAttributesWithoutValue", [ignore,]) - - - def wait_for_condition(self,script,timeout): - """ - Runs the specified JavaScript snippet repeatedly until it evaluates to "true". - The snippet may have multiple lines, but only the result of the last line - will be considered. - - - Note that, by default, the snippet will be run in the runner's test window, not in the window - of your application. To get the window of your application, you can use - the JavaScript snippet ``selenium.browserbot.getCurrentWindow()``, and then - run your JavaScript in there - - - 'script' is the JavaScript snippet to run - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForCondition", [script,timeout,]) - - - def set_timeout(self,timeout): - """ - Specifies the amount of time that Selenium will wait for actions to complete. - - - Actions that require waiting include "open" and the "waitFor\*" actions. - - The default timeout is 30 seconds. - - 'timeout' is a timeout in milliseconds, after which the action will return with an error - """ - self.do_command("setTimeout", [timeout,]) - - - def wait_for_page_to_load(self,timeout): - """ - Waits for a new page to load. - - - You can use this command instead of the "AndWait" suffixes, "clickAndWait", "selectAndWait", "typeAndWait" etc. - (which are only available in the JS API). - - Selenium constantly keeps track of new pages loading, and sets a "newPageLoaded" - flag when it first notices a page load. Running any other Selenium command after - turns the flag to false. Hence, if you want to wait for a page to load, you must - wait immediately after a Selenium command that caused a page-load. - - - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForPageToLoad", [timeout,]) - - - def wait_for_frame_to_load(self,frameAddress,timeout): - """ - Waits for a new frame to load. - - - Selenium constantly keeps track of new pages and frames loading, - and sets a "newPageLoaded" flag when it first notices a page load. - - - See waitForPageToLoad for more information. - - 'frameAddress' is FrameAddress from the server side - 'timeout' is a timeout in milliseconds, after which this command will return with an error - """ - self.do_command("waitForFrameToLoad", [frameAddress,timeout,]) - - - def get_cookie(self): - """ - Return all cookies of the current page under test. - - """ - return self.get_string("getCookie", []) - - - def get_cookie_by_name(self,name): - """ - Returns the value of the cookie with the specified name, or throws an error if the cookie is not present. - - 'name' is the name of the cookie - """ - return self.get_string("getCookieByName", [name,]) - - - def is_cookie_present(self,name): - """ - Returns true if a cookie with the specified name is present, or false otherwise. - - 'name' is the name of the cookie - """ - return self.get_boolean("isCookiePresent", [name,]) - - - def create_cookie(self,nameValuePair,optionsString): - """ - Create a new cookie whose path and domain are same with those of current page - under test, unless you specified a path for this cookie explicitly. - - 'nameValuePair' is name and value of the cookie in a format "name=value" - 'optionsString' is options for the cookie. Currently supported options include 'path', 'max_age' and 'domain'. the optionsString's format is "path=/path/, max_age=60, domain=.foo.com". The order of options are irrelevant, the unit of the value of 'max_age' is second. Note that specifying a domain that isn't a subset of the current domain will usually fail. - """ - self.do_command("createCookie", [nameValuePair,optionsString,]) - - - def delete_cookie(self,name,optionsString): - """ - Delete a named cookie with specified path and domain. Be careful; to delete a cookie, you - need to delete it using the exact same path and domain that were used to create the cookie. - If the path is wrong, or the domain is wrong, the cookie simply won't be deleted. Also - note that specifying a domain that isn't a subset of the current domain will usually fail. - - Since there's no way to discover at runtime the original path and domain of a given cookie, - we've added an option called 'recurse' to try all sub-domains of the current domain with - all paths that are a subset of the current path. Beware; this option can be slow. In - big-O notation, it operates in O(n\*m) time, where n is the number of dots in the domain - name and m is the number of slashes in the path. - - 'name' is the name of the cookie to be deleted - 'optionsString' is options for the cookie. Currently supported options include 'path', 'domain' and 'recurse.' The optionsString's format is "path=/path/, domain=.foo.com, recurse=true". The order of options are irrelevant. Note that specifying a domain that isn't a subset of the current domain will usually fail. - """ - self.do_command("deleteCookie", [name,optionsString,]) - - - def delete_all_visible_cookies(self): - """ - Calls deleteCookie with recurse=true on all cookies visible to the current page. - As noted on the documentation for deleteCookie, recurse=true can be much slower - than simply deleting the cookies using a known domain/path. - - """ - self.do_command("deleteAllVisibleCookies", []) - - - def set_browser_log_level(self,logLevel): - """ - Sets the threshold for browser-side logging messages; log messages beneath this threshold will be discarded. - Valid logLevel strings are: "debug", "info", "warn", "error" or "off". - To see the browser logs, you need to - either show the log window in GUI mode, or enable browser-side logging in Selenium RC. - - 'logLevel' is one of the following: "debug", "info", "warn", "error" or "off" - """ - self.do_command("setBrowserLogLevel", [logLevel,]) - - - def run_script(self,script): - """ - Creates a new "script" tag in the body of the current test window, and - adds the specified text into the body of the command. Scripts run in - this way can often be debugged more easily than scripts executed using - Selenium's "getEval" command. Beware that JS exceptions thrown in these script - tags aren't managed by Selenium, so you should probably wrap your script - in try/catch blocks if there is any chance that the script will throw - an exception. - - 'script' is the JavaScript snippet to run - """ - self.do_command("runScript", [script,]) - - - def add_location_strategy(self,strategyName,functionDefinition): - """ - Defines a new function for Selenium to locate elements on the page. - For example, - if you define the strategy "foo", and someone runs click("foo=blah"), we'll - run your function, passing you the string "blah", and click on the element - that your function - returns, or throw an "Element not found" error if your function returns null. - - We'll pass three arguments to your function: - - * locator: the string the user passed in - * inWindow: the currently selected window - * inDocument: the currently selected document - - - The function must return null if the element can't be found. - - 'strategyName' is the name of the strategy to define; this should use only letters [a-zA-Z] with no spaces or other punctuation. - 'functionDefinition' is a string defining the body of a function in JavaScript. For example: ``return inDocument.getElementById(locator);`` - """ - self.do_command("addLocationStrategy", [strategyName,functionDefinition,]) - - - def capture_entire_page_screenshot(self,filename,kwargs): - """ - Saves the entire contents of the current window canvas to a PNG file. - Contrast this with the captureScreenshot command, which captures the - contents of the OS viewport (i.e. whatever is currently being displayed - on the monitor), and is implemented in the RC only. Currently this only - works in Firefox when running in chrome mode, and in IE non-HTA using - the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly - borrowed from the Screengrab! Firefox extension. Please see - http://www.screengrab.org and http://snapsie.sourceforge.net/ for - details. - - 'filename' is the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code. - 'kwargs' is a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options: - * background - the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). - - - """ - self.do_command("captureEntirePageScreenshot", [filename,kwargs,]) - - - def rollup(self,rollupName,kwargs): - """ - Executes a command rollup, which is a series of commands with a unique - name, and optionally arguments that control the generation of the set of - commands. If any one of the rolled-up commands fails, the rollup is - considered to have failed. Rollups may also contain nested rollups. - - 'rollupName' is the name of the rollup command - 'kwargs' is keyword arguments string that influences how the rollup expands into commands - """ - self.do_command("rollup", [rollupName,kwargs,]) - - - def add_script(self,scriptContent,scriptTagId): - """ - Loads script content into a new script tag in the Selenium document. This - differs from the runScript command in that runScript adds the script tag - to the document of the AUT, not the Selenium document. The following - entities in the script content are replaced by the characters they - represent: - - < - > - & - - The corresponding remove command is removeScript. - - 'scriptContent' is the Javascript content of the script to add - 'scriptTagId' is (optional) the id of the new script tag. If specified, and an element with this id already exists, this operation will fail. - """ - self.do_command("addScript", [scriptContent,scriptTagId,]) - - - def remove_script(self,scriptTagId): - """ - Removes a script tag from the Selenium document identified by the given - id. Does nothing if the referenced tag doesn't exist. - - 'scriptTagId' is the id of the script element to remove. - """ - self.do_command("removeScript", [scriptTagId,]) - - - def use_xpath_library(self,libraryName): - """ - Allows choice of one of the available libraries. - - 'libraryName' is name of the desired library Only the following three can be chosen: - * "ajaxslt" - Google's library - * "javascript-xpath" - Cybozu Labs' faster library - * "default" - The default library. Currently the default library is "ajaxslt" . - - If libraryName isn't one of these three, then no change will be made. - """ - self.do_command("useXpathLibrary", [libraryName,]) - - - def set_context(self,context): - """ - Writes a message to the status bar and adds a note to the browser-side - log. - - 'context' is the message to be sent to the browser - """ - self.do_command("setContext", [context,]) - - - def attach_file(self,fieldLocator,fileLocator): - """ - Sets a file input (upload) field to the file listed in fileLocator - - 'fieldLocator' is an element locator - 'fileLocator' is a URL pointing to the specified file. Before the file can be set in the input field (fieldLocator), Selenium RC may need to transfer the file to the local machine before attaching the file in a web page form. This is common in selenium grid configurations where the RC server driving the browser is not the same machine that started the test. Supported Browsers: Firefox ("\*chrome") only. - """ - self.do_command("attachFile", [fieldLocator,fileLocator,]) - - - def capture_screenshot(self,filename): - """ - Captures a PNG screenshot to the specified file. - - 'filename' is the absolute path to the file to be written, e.g. "c:\blah\screenshot.png" - """ - self.do_command("captureScreenshot", [filename,]) - - - def capture_screenshot_to_string(self): - """ - Capture a PNG screenshot. It then returns the file as a base 64 encoded string. - - """ - return self.get_string("captureScreenshotToString", []) - - - def captureNetworkTraffic(self, type): - """ - Returns the network traffic seen by the browser, including headers, AJAX requests, status codes, and timings. When this function is called, the traffic log is cleared, so the returned content is only the traffic seen since the last call. - - 'type' is The type of data to return the network traffic as. Valid values are: json, xml, or plain. - """ - return self.get_string("captureNetworkTraffic", [type,]) - - def addCustomRequestHeader(self, key, value): - """ - Tells the Selenium server to add the specificed key and value as a custom outgoing request header. This only works if the browser is configured to use the built in Selenium proxy. - - 'key' the header name. - 'value' the header value. - """ - return self.do_command("addCustomRequestHeader", [key,value,]) - - def capture_entire_page_screenshot_to_string(self,kwargs): - """ - Downloads a screenshot of the browser current window canvas to a - based 64 encoded PNG file. The \ *entire* windows canvas is captured, - including parts rendered outside of the current view port. - - Currently this only works in Mozilla and when running in chrome mode. - - 'kwargs' is A kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD". This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text). - """ - return self.get_string("captureEntirePageScreenshotToString", [kwargs,]) - - - def shut_down_selenium_server(self): - """ - Kills the running Selenium Server and all browser sessions. After you run this command, you will no longer be able to send - commands to the server; you can't remotely start the server once it has been stopped. Normally - you should prefer to run the "stop" command, which terminates the current browser session, rather than - shutting down the entire server. - - """ - self.do_command("shutDownSeleniumServer", []) - - - def retrieve_last_remote_control_logs(self): - """ - Retrieve the last messages logged on a specific remote control. Useful for error reports, especially - when running multiple remote controls in a distributed environment. The maximum number of log messages - that can be retrieve is configured on remote control startup. - - """ - return self.get_string("retrieveLastRemoteControlLogs", []) - - - def key_down_native(self,keycode): - """ - Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyDownNative", [keycode,]) - - - def key_up_native(self,keycode): - """ - Simulates a user releasing a key by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyUpNative", [keycode,]) - - - def key_press_native(self,keycode): - """ - Simulates a user pressing and releasing a key by sending a native operating system keystroke. - This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing - a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and - metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular - element, focus on the element first before running this command. - - 'keycode' is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes! - """ - self.do_command("keyPressNative", [keycode,]) - diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite.py deleted file mode 100644 index 33403737e7..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import unittest -import test_ajax_jsf -import test_default_server -import test_google -import test_i18n -import sys - -def suite(): - return unittest.TestSuite((\ - unittest.makeSuite(test_ajax_jsf.TestAjaxJSF), - unittest.makeSuite(test_default_server.TestDefaultServer), - unittest.makeSuite(test_google.TestGoogle), - unittest.makeSuite(test_i18n.TestI18n), - )) - -if __name__ == "__main__": - result = unittest.TextTestRunner(verbosity=2).run(suite()) - sys.exit(not result.wasSuccessful()) diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite_headless.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite_headless.py deleted file mode 100644 index f8af0e5839..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/selenium_test_suite_headless.py +++ /dev/null @@ -1,31 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -import unittest -import test_ajax_jsf -import test_default_server -import test_google -import test_i18n -import sys - -def suite(): - return unittest.TestSuite((\ - unittest.makeSuite(test_i18n.TestI18n), - )) - -if __name__ == "__main__": - result = unittest.TextTestRunner(verbosity=2).run(suite()) - sys.exit(not result.wasSuccessful()) diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_ajax_jsf.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_ajax_jsf.py deleted file mode 100644 index 22b19bfe60..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_ajax_jsf.py +++ /dev/null @@ -1,54 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from selenium import selenium -import unittest -import sys, time - -class TestAjaxJSF(unittest.TestCase): - - seleniumHost = 'localhost' - seleniumPort = str(4444) - #browserStartCommand = "c:\\program files\\internet explorer\\iexplore.exe" - browserStartCommand = "*firefox" - browserURL = "http://www.irian.at" - - def setUp(self): - print "Using selenium server at " + self.seleniumHost + ":" + self.seleniumPort - self.selenium = selenium(self.seleniumHost, self.seleniumPort, self.browserStartCommand, self.browserURL) - self.selenium.start() - - def testKeyPress(self): - selenium = self.selenium - input_id = 'ac4' - update_id = 'ac4update' - - selenium.open("http://www.irian.at/selenium-server/tests/html/ajax/ajax_autocompleter2_test.html") - selenium.key_press(input_id, 74) - time.sleep(0.5) - selenium.key_press(input_id, 97) - selenium.key_press(input_id, 110) - time.sleep(0.5) - self.failUnless('Jane Agnews' == selenium.get_text(update_id)) - selenium.key_press(input_id, '\9') - time.sleep(0.5) - self.failUnless('Jane Agnews' == selenium.get_value(input_id)) - - def tearDown(self): - self.selenium.stop() - -if __name__ == "__main__": - unittest.main() \ No newline at end of file diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_default_server.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_default_server.py deleted file mode 100644 index a037aa8d40..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_default_server.py +++ /dev/null @@ -1,52 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from selenium import selenium -import unittest -import sys, time - -class TestDefaultServer(unittest.TestCase): - - seleniumHost = 'localhost' - seleniumPort = str(4444) - #browserStartCommand = "c:\\program files\\internet explorer\\iexplore.exe" - browserStartCommand = "*firefox" - browserURL = "http://localhost:4444" - - def setUp(self): - print "Using selenium server at " + self.seleniumHost + ":" + self.seleniumPort - self.selenium = selenium(self.seleniumHost, self.seleniumPort, self.browserStartCommand, self.browserURL) - self.selenium.start() - - def testLinks(self): - selenium = self.selenium - selenium.open("/selenium-server/tests/html/test_click_page1.html") - self.failUnless(selenium.get_text("link").find("Click here for next page") != -1, "link 'link' doesn't contain expected text") - links = selenium.get_all_links() - self.failUnless(len(links) > 3) - self.assertEqual("linkToAnchorOnThisPage", links[3]) - selenium.click("link") - selenium.wait_for_page_to_load(5000) - self.failUnless(selenium.get_location().endswith("/selenium-server/tests/html/test_click_page2.html")) - selenium.click("previousPage") - selenium.wait_for_page_to_load(5000) - self.failUnless(selenium.get_location().endswith("/selenium-server/tests/html/test_click_page1.html")) - - def tearDown(self): - self.selenium.stop() - -if __name__ == "__main__": - unittest.main() diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_google.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_google.py deleted file mode 100644 index b098f64c47..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_google.py +++ /dev/null @@ -1,38 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from selenium import selenium -import unittest - -class TestGoogle(unittest.TestCase): - def setUp(self): - self.selenium = selenium("localhost", \ - 4444, "*firefox", "http://www.google.com/webhp") - self.selenium.start() - - def test_google(self): - sel = self.selenium - sel.open("http://www.google.com/webhp") - sel.type("q", "hello world") - sel.click("btnG") - sel.wait_for_page_to_load(5000) - self.assertEqual("hello world - Google Search", sel.get_title()) - - def tearDown(self): - self.selenium.stop() - -if __name__ == "__main__": - unittest.main() diff --git a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_i18n.py b/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_i18n.py deleted file mode 100644 index 603f4840a0..0000000000 --- a/scripts/testing/tools/selenium/1.0.3/python-client-driver/test_i18n.py +++ /dev/null @@ -1,49 +0,0 @@ -""" -Copyright 2006 ThoughtWorks, Inc. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -""" - -from selenium import selenium -import unittest - -class TestI18n(unittest.TestCase): - def setUp(self): - self.selenium = selenium("localhost", \ - 4444, "*mock", "http://localhost:4444") - self.selenium.start() - self.selenium.open("http://localhost:4444/selenium-server/tests/html/test_i18n.html") - - def test_i18n(self): - romance = u"\u00FC\u00F6\u00E4\u00DC\u00D6\u00C4 \u00E7\u00E8\u00E9 \u00BF\u00F1 \u00E8\u00E0\u00F9\u00F2" - korean = u"\uC5F4\uC5D0" - chinese = u"\u4E2D\u6587" - japanese = u"\u307E\u3077" - dangerous = "&%?\\+|,%*" - self.verify_text("romance", romance) - self.verify_text("korean", korean) - self.verify_text("chinese", chinese) - self.verify_text("japanese", japanese) - self.verify_text("dangerous", dangerous) - - def verify_text(self, id, expected): - sel = self.selenium - self.failUnless(sel.is_text_present(expected)) - actual = sel.get_text(id) - self.assertEqual(expected, actual) - - def tearDown(self): - self.selenium.stop() - -if __name__ == "__main__": - unittest.main() diff --git a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-coreless.jar b/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-coreless.jar deleted file mode 100644 index c66a97d966..0000000000 Binary files a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-coreless.jar and /dev/null differ diff --git a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-sources.jar b/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-sources.jar deleted file mode 100644 index ecfbf7f1be..0000000000 Binary files a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server-sources.jar and /dev/null differ diff --git a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server.jar b/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server.jar deleted file mode 100644 index 004d7daca2..0000000000 Binary files a/scripts/testing/tools/selenium/1.0.3/rc-server/selenium-server.jar and /dev/null differ diff --git a/scripts/testing/tools/selenium/1.0.3/rc-server/sslSupport/cybervillainsCA.cer b/scripts/testing/tools/selenium/1.0.3/rc-server/sslSupport/cybervillainsCA.cer deleted file mode 100644 index 307fcd7f02..0000000000 Binary files a/scripts/testing/tools/selenium/1.0.3/rc-server/sslSupport/cybervillainsCA.cer and /dev/null differ