Selenium Tutorial Day 73 - Selenium RC Overview

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 12

Portnov Computer School presents:

Selenium
Web Test Tool Training
Discover the automating power of Selenium

Presented by:
Kangeyan Passoubady (Kangs)

Copy Right: 2009-2011, All rights reserved by Kangeyan Passoubady (Kangs). Republishing requires author’s permission
7 Day
Selenium RC Overview

Discover the automating power of Selenium


Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 2
Selenium Overview

• Selenium consists of
–Selenium IDE
–Selenium Core
–Selenium RC
–Selenium Ruby on Rails
–Selenium Grid
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 3
Selenium RC #1
• Selenium Remote Control (RC) is a test
tool that allows testers to write automated
Web Application User Interface tests in
many programming languages against
any HTTP website using any mainstream
JavaScript-enabled browser.
• Selenium RC comes in two parts.
– A server which automatically launches
and kills browsers, and acts as a HTTP
proxy for web requests from them.
– Client libraries for computer languages.
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 4
Selenium RC Architecture

Selenium RC
Server

Point to any
supported browser

Your Test Suites


written in any
supported
programming
language

Discover the automating power of Selenium


Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 5
Platforms Supported by Selenium RC
• Browsers
– Firefox, IE, Safari and Opera
• Operating Systems
– Windows, OS X, Linux, and Solaris
• Programming Languages
– C#, Java, Perl, PHP, Python, and Ruby
• Testing Frameworks
– Bromine, JUnit & TenstNG (Java), NUnit (.Net),
RSpec & Test::Unit (Ruby), unittest (Python)

Discover the automating power of Selenium


Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 6
Selenium RC #2
• The Selenium RC Server is used for testing complex
AJAX-based web user interfaces under a Continuous
Integration system.
• Selenium RC is used with Selenium Core/Selenium
IDE to write tests in programming languages other
than the Selenese HTML table format.
• The RC server is bundled with Selenium Core and
automatically loads it into the browser.
• Without using special modes, using Selenium RC test
script, one cannot test domain changing web
applications or within the same domain to change
from insecure (http) page to secure (https) page.
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 7
RC Command Line Options
Usage: java -jar selenium-server.jar [-interactive] [-options]
• port <nnnn>:(default 4444)
– the port number the selenium server should use
• timeout <nnnn>: (eg: 180)
– an integer number of seconds
• interactive:
– Interactively enter the commands.
• multiWindow:
– Tests are executed in a separate window and supports web
pages with frames.
• forcedBrowserMode <browser>: (eg: *iehta)
– sets the forced default browser mode (e.g. "*iexplore“) for all
sessions, no matter what is passed in
getNewBrowserSession
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 8
RC Command Line Options
• userExtensions <file>:
– indicates a JavaScript file that will be loaded into selenium
• browserSessionReuse:
– stops re-initialization and spawning of the browser between
tests
• avoidProxy:
– Uses by default proxy for browser request
– set this flag to make the browser use proxy only for URLs
containing '/selenium-server'
• firefoxProfileTemplate <dir>:
– By default generates a fresh empty Firefox profile for every
test.
– Provide a directory to use your profile directory instead.
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 9
RC Command Line Options
• debug:
– Debug mode provides more trace information and used for
diagnostics purpose
• log:
– When enabled writes debug information out to a log file
• htmlSuite <browser> <startURL> <suiteFile> <resultFile>:
– Provide browser and URL to run a single HTML Selenese
Test suite and then exit immediately.
– Provide absolute path to the HTML test suite, and HTML
results file.
• proxyInjectionMode:
– A proxy injection mode is a mode where the selenium server acts as a
proxy server for all content going to the AUT. Under this mode, multiple
domains can be visited.
Discover the automating power of Selenium
Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 10
RC Command Line Options
• The following additional flags are supported for proxy injection
mode :
– dontInjectRegex <regex>: an optional regular expression
that proxy injection mode can use to know when to bypass
injection
– userJsInjection <file>: specifies a JavaScript file which will
then be injected into all pages
• userContentTransformation <regex> <replacement>:
– A regular expression which is matched against all test HTML content;
the second is a string which will replace matches. These flags can be
used any number of times. A simple example of how this could be
useful: if you add "-userContentTransformation https http" then all
"https" strings in the HTML of the test application will be changed to be
"http".

Discover the automating power of Selenium


Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 11
RC Command Line Options
• Java system properties:
– Dhttp.proxyHost and -Dhttp.proxyPort
• Normally Selenium RC overrides the proxy server configuration, using the
Selenium Server as a proxy. Use these options if you need to use your own
proxy together with the Selenium Server proxy.

• Use the proxy settings like this:


– java -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=1234 -jar
selenium-server.jar
– HTTP proxy requires authentication, you will also need to set
-Dhttp.proxyUser and -Dhttp.proxyPassword, in addition to
http.proxyHost and http.proxyPort.
– java -Dhttp.proxyHost=myproxy.com -Dhttp.proxyPort=1234
-Dhttp.proxyUser=joe -Dhttp.proxyPassword=example -jar selenium-
server.jar

Discover the automating power of Selenium


Copyright © 2009-2011 by Kangeyan Passoubady (Kangs) 12

You might also like