Changes

Jump to: navigation, search

Bugzilla:QA

616 bytes removed, 19:31, 31 July 2008
m
Writing Selenium scripts
=== Scripts running from a web browser ===
This is the easiest way to use SeleniumTill Bugzilla 3. After having downloaded and untar'ed the tarball (we still use version 0.6.0 despite 0.8.1 is outx, for compatibility issues), scripts simply consist of a table with three columns (command, field, value). A template is available Selenium tests were all written in [https://bugzillaHTML.mozillaIt has been decided for Bugzilla 3.org/show_bug.cgi?id=317695 bug 317695] (template.html)2 RC1 and newer to convert them to Perl, as well as a useful Javascript file for most common actions (user-extensionsgiving us more flexibility and control.js)We no longer write test scripts in HTML.
=== Perl Selenium scripts ===The fastest way to write Selenium scripts is to use [http://openqa.org/selenium-ide/ selenium-IDE] ([https://addons.mozilla.org/extensions/moreinfo.php?application=firefox&category=Newest&numpg=10&id=2079 amo], formerly [http://seleniumrecorder.mozdev.org/ Selenium Recorder]) . Selenium-IDE is a Firefox extension which writes scripts for you. It records your actions and converts them into a valid Selenium script. If you decide to install this extension, you don't need to install Selenium separately; everything is included in the XPI package (samples and docs are not included though). You can also write Selenium scripts with a text editor, but this is longer and can be pretty painful.
=== Scripts called by a In order to run these Perl scripts, you first have to install 2 Perl program ===modules, both of which are available on CPAN:The installation and configuration are a bit harder [http://search.cpan. First download and install org/~lukec/Alien-SeleniumRC/ Alien::SeleniumRC] [http://search.cpan.org/~lukec/Test-WWW-Selenium/ Test::WWW::Selenium]. In case you still use version 0.03, the following modules are required too:
requiresEach command is then of the form $sel->command_name_ok('field', 'value', 'description'), where $sel is the test object created by Test:: AlienWWW::Selenium Frontier::Client Frontier::RPC2 LWP v5and which will do the interface between your test script and your Bugzilla installation.8 POE v0The description is optional, but gives very useful information.29 POE::Component::ClientA typical output is of the form::UserAgent POE::Component::Server::HTTP Test::LongStringbuild_requires: HTTP::Daemon Test::More v0.47
When all these modules are installed #perl test_enter_new_bug.t ok 1 - open, you will also need the SeleniumTest.pm module available in [https:/bugzilla/ ok 2 - Enter admin login name ok 3 - Enter admin password ok 4 - Submit credentials ok 5 - open, /bugzilla.mozilla.org/show_bugenter_bug.cgi?idproduct=317695 bug 317695] which is a simplified version of the one given with TestProduct ok 6 - Display enter_bug.cgi for the Testselected product (bypass classifications) ok 7 -WWWEnter bug summary ok 8 -Selenium tarball. An example of a test script Enter bug description ok 9 - 012qaSubmit bug data to post_bug.t cgi ok 10 - is also provided, which can eBug created 1.g. be executed with runtests.pl, a Perl script available in the Bugzilla distribution.10
For newer versions What you can read here are the descriptions given for each command of Test::WWW::Selenium, requirements are different and SeleniumTest.pm is no longer required. Note that your old scripts running on 0.03 won't run on newer versions anymorethe script.This makes debugging much easier!
As you Existing Selenium scripts can see, the syntax is different between HTML and Perl scripts, but the commands remain mostly the samebe found in bugs depending on [http://landfill.bugzilla. Make sure to end all your commands by "_ok" to generate an output on your screenorg/bugzillaqa/show_bug. The format is now $test->command_name_ok('field', 'value', 'description'), where $test is the test object created by SeleniumTestcgi?id=3065 bug 3065].pm and which will do Members of the interface between your test script and the web installation.QA team can use CVS to get them all at once using:
The description is optional, but gives very useful information cvs -d my_login@landfill. A typical output is of the formbugzilla.org:/cvsroot co selenium
t/012qa....1..7 ok 1 - Load query.cgi ok 2 - Check title ok 3 - Enter and check input in the short_desc field ok 4 - Recheck the input (using a different method) ok 5 - Submit request (-> buglist.cgi) ok 6 - Check title ok 7 - Make sure that no bug where my_login is returned (0 bug found) ok All tests successfulyour user account name on landfill.
What you can read here are the descriptions given for each command of the script. This makes debugging much easier!
[[category:Bugzilla|QA]]
[http://www.bugzilla.jp/bzwiki/bz/Bugzilla:QA Ja]
Confirm
683
edits

Navigation menu