Escolar Documentos
Profissional Documentos
Cultura Documentos
Software testing using an automatic test program will generally avoid the errors
that humans make when they get tired after multiple repetitions. The test
program won't skip any tests by mistake. The test program can also record the
results of the test accurately. The results can be automatically fed into a
database that may provide useful statistics on how well the software
development process is going. On the other hand, software that is tested
manually will be tested with a randomness that helps find bugs in more varied
situations. Since a software program usually won't vary each time it is run, it may
not find some bugs that manual testing will. Automated software testing is never
a complete substitute for manual testing.
Definition:
Software testing assisted with software tools that require no operator input,
analysis, or evaluation.
Benefits:
About Selenium:
(1) Selenium Core tests run directly in a browser, just as real users do. And
they run in Internet Explorer, Mozilla and Firefox on Windows, Linux and
Macintosh. No other test tool covers such a wide variety of platforms.
(2) Browser Compatibility Testing> Test your application to see if it works
correctly on different browsers and operating systems. The same script
can run on any Selenium platform.
(3) System functional testing> Create regression tests to verify application
functionality and user acceptance.
(i) Windows:
Known Working:
Should Work:
(ii) Mac OS X:
Known Working:
Should work:
(a) OmniWeb
(iii) Linux:
Known Working:
(1) The Selenium Server is written in Java, and requires the Java Runtime
Environment (JRE) version 1.5.0 or higher in order to start. You may already
have it installed. Try running this from the command line:
java –version
You should see a brief message telling you what version of Java is installed, like
this:
If you see an error message instead, you may need to install the JRE
(http://www.java.com/en/download/manual.jsp),
Or you may need to add it to your PATH environment variable if Java Runtime
Environment was already installed.
For this example, you'll also need to make sure that you have a supported
browser installed.
Windows:
(i) If you're using Windows XP or Windows 2003, you can just use Internet
Explorer for this example, or install Mozilla Firefox or Opera.
(ii) If you're using Windows 2000, you'll need to install reg.exe in order to use
Internet Explorer, but Firefox should work regardless.
Add your browser executable to your PATH environment variable. (If you do not
explicitly add your browser's installation directory to the PATH, then you must
install your browser in its standard location; Firefox's standard location is
"c:\Program Files\Mozilla Firefox\firefox.exe"; Internet Explorer's standard
location is "c:\Program Files\Internet Explorer\iexplore.exe".)
(i) You'll need to run Perl on "Makefile.PL" to autogenerate a makefile, run the
below command at command prompt
Note: Do not specify any filename after nmake. By default it takes Makefile.PL as
a file parameter.
Small Reference:
Make
nmake - If you download modules from CPAN, you will often need to install
them with the 'make' utility. NMAKE15.EXE is a self-extracting zip file. When it's
executed, it will create 3 files on your disk (nmake.exe, nmake.err, and
readme.txt). Move nmake.* to c:\perl\bin, which should be on the path. Then you
can run this standard perl command set for installing modules:
After running this command, displays results with total number of tests, tests
passed, tests failed, % of tests failed. You need not worry about these statistics.
This is a bug filed under Selenium-Remote-Control. But, still you can go ahead
from this step and execute Automated Test Script.
(iv) and then run "nmake install" to install it into your Perl distribution.
Note that this Makefile is incompatible with cygwin's GNU make; on Windows you
should use nmake instead. (Note that nmake comes along with ActiveState Perl;
it should already be available in your Perl\bin directory.)
Once you've installed the Perl Client Driver in one way or another, you'll need to
use its modules. Just as there's more than one way to install the Perl Client
Driver, there is also more than one way to use it.
First, make sure you've already started the Selenium Server separately in
another process. The Selenium Server should remain up and running throughout
this process; you shouldn't need to start/stop it each time you use the Client
Driver. (Though, of course, if you need to start and stop the server, you certainly
can, just by automatically starting it from the command line.)
Note: Please make sure the port number should be same in Selenium
automated test script and when starting the selenium server jar file.
If you're going to use the driver for automated testing, you may prefer to use
Test::WWW::Selenium instead. Test::WWW::Selenium subclasses
WWW::Selenium and provides convenient testing functions, suitable for use with
Test::More. Test::WWW::Selenium does not require explicit start/stop commands
(since these will be handled during test cleanup), and allows you to quickly make
any Selenium method a test simply by adding the suffix "_ok" to any Selenium
method. Hence, instead of using $sel->click you can use $sel->click_ok to make
it a test. In addition, for each Selenium getter (get_title, ...) there are six
autogenerated methods (<getter>_is, <getter>_isnt, <getter>_like,
<getter>_unlike, <getter>_contains, <getter>_lacks) to check the value of the
attribute).
(1) Created a folder ‘Smoke Tests’ in \\Perl\bin\ where Active Perl was installed,
keep all your smoke test scripts in ‘Smoke Tests’ folder.
(2) Make sure the port number defined in Perl Test Script and in Selenium Server
jar file is same.
(3) Start the Selenium-server.jar file from command prompt.
(4) Open another command prompt and follow the below steps to execute
selenium perl script:
Change to Smoke Test Scripts directory from root where active perl was
installed.
Execute perl test script from command prompt by typing the following command
Definitions:
Server - A program designed to accept HTTP requests from Client Drivers and
respond with the results of those commands.
Selenium Core - The product that defines the core HTML/JS standard for
Selenium. It defines all Selenium Commands that can be performed as well as
the communication protocol between the Selenium Server and the Browser.
HTTP Parameters - Name/value pairs that have been URL encoded in the
manner of an HTML form data set. In HTTP GET requests, HTTP Parameters
MUST appear in the URL of the request. In HTTP POST requests, HTTP
Parameters MUST be encoded in the body of the HTTP request. (Surprisingly,
this standard is not defined in any HTTP or URL RFC, but is only defined in the
specifications for HTML [1].)
Parameters - A short name for HTTP GET Parameters. When used in this way,
"Parameters" will always be capitalized.
References:
http://www.openqa.org/
http://search.cpan.org/src/LUKEC/Test-WWW-Selenium-1.10/README
http://www.openqa.org/selenium-rc/perl/index.html