Selenium Tutorial

Components of Selenium: a. Selenium IDE - Plugin to Firefox to record and play test in firefox and also export tests in different languages. The most appealing format is the html test case which seems to based on fit html.
b. Selenium RC- Allows playing of exported test in different platform/OS.
c. Selenium Grid - Allows to control lots of selenium machines.

Selenium RC Tutorial: Selenium RC is a Java based command line server that starts browsers and runs commands you pass from your tests.

Steps to set up the Selenium tool and execute the test case:

1. Install Selenium IDE

2. Record a test case using Selenium IDE in firefox and Export file as “PHP selanium RC” with filename Example.php

3. Open PHP file in notepad and verify that following code should be displayed:


Last line Complexity in the code - ‘$this->getText…’. The function ‘getText’ returns the text found at the element specified in the expression. The complex looking line is an xpath expression.

An easy way is to use the XPather Firefox addon to get the xpath of any element on a page. After you download and install the addon, restart Firefox, right-click on any element and from the context menu select ‘Show in XPather’. XPather retrieves the xpath to the specified element, which you can than use in your test code.

4. Download and Install Java Runtime

5. Downloaded Selenium RC

6. Start the Selenium RC server by typing “java -jar selenium-server.jar” command in command prompt.

7. Now the server is ready to accept test commands from your PHP script. Make sure you keep this server running till you finish testing.

8. Download and Install WAMP and PHPUnit on Windows.

a. Once you have installed and setup WAMP, open up the command prompt and go to your php directory in WAMP [C:\>cd wamp\bin\php\php5.2.5]

b. From here you must run the go-pear.bat file to install PEAR and all the files needed for it [C:\wamp\bin\php\php5.2.5>go-pear.bat]

c. When executed PEAR will ask you a series of question to set itself up correctly, if you don’t know what your doing then just accept the defaults.

d. Once installed you must run the PEAR_ENV.reg which will create the environment variables for the user, so that PEAR can be called in any directory on the command line [C:\wamp\bin\php\php5.2.5>PEAR_ENV.reg].

e. It should work but if you cannot call PEAR from the command prompt, then you must manually add the directory to the path in the Environment Variables list, found in System Properties -> Advanced-> Environment Variables, then add the directory [C:\wamp\bin\php\php5.2.5 to the PATH variable].

f. Once you have PEAR setup, then you must register the PHPUnit channel with PEAR [C:\wamp\bin\php\php5.2.5>pear channel-discover pear.phpunit.de].

g. Now you can use the PEAR to install packages from the PHPUnit channel [C:\wamp\bin\php\php5.2.5>pear install phpunit/PHPUnit]

9. Copy and paste the “Example.php” file in php folder [C:\wamp\bin\php\php5.2.8]

10. Open another command window and write [cd C:\wamp\bin\php\php5.2.8]

11. Run command [phpunit Example]

Run LoadRunner Controller from command line?

You can open LoadRunner Controller scenario with:

LoadRunner\bin\Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder


For example: 


(note: click the image to enlarge it)

As a result of above command, LoadRunner Controller: 

  • starts
  • opens Controller scenario
  • executes it
  • saves results to folder 'C:\Temp\LR_Res\result_0'
After that, Controller finishes working and closes.
Please, see files from created 'C:\Temp\LR_Res\result_0' folder:



Tips: As you see, there is LoadRunner Result file (result_0.lrr). You can pass it automatically to LoadRunner Analysis for further processing.

Actually, Wlrun.exe can have several settings. There are their descriptions from HP LoadRunner Controller User's Guide (© HP/Mercury Interactive):

TestPathPath to the scenario.
For example, C:\LoadRunner\scenario\Scenario.lrs
If the path includes blank spaces, use quotation marks.
RunRuns the scenario, dumps all output messages into res_dir\output.txt and closes Controller
InvokeAnalysisInstructs LoadRunner to invoke Analysis upon scenario termination. If this argument is not specified, LoadRunner uses the scenario default setting.
ResultNameFull results path. For example, "C:\Temp\Res_01"
ResultCleanNameResults name. For example, "Res_01"
ResultLocationResults directory. For example, "C:\Temp"

Note: ResultName (full path) = ResultLocation (directory) + ResultCleanName (name)



Well, let's see different variants of how to open and run LoadRunner Controller script: 


1. Open LoadRunner Controller:

  Wlrun.exe


2. Open LoadRunner Controller scenario 'scenario.lrs' and do not execute it: 

  Wlrun.exe -TestPath scenario.lrs


3. Open LoadRunner Controller scenario 'scenario.lrs', execute it, and save results to default folder ('C:\Documents and Settings\user_login\Local Settings\Temp\res'): 

  Wlrun.exe -Run -TestPath scenario.lrs



4. Open LoadRunner Controller scenario 'scenario.lrs', execute it, and save results to 'res_folder' folder:


 Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder

5. Open LoadRunner Controller scenario 'scenario.lrs', execute it, save results to 'res_folder' folder, and after that start Analysis on created results with default template: 


Wlrun.exe -Run -TestPath scenario.lrs -ResultName res_folder - InvokeAnalysis


And please see more complex example for desert :) 

6. Open LoadRunner Controller scenario 'scenario.lrs', execute it, save results to 'res_folder' folder, and after that start Analysis on created results with default template. Repeat all these steps 10 times: 

 set LR_HOME=C:\Program Files\Mercury\LoadRunner
 for /L %%i in (1,1,10) do "%LR_HOME%\bin\Wlrun.exe" -Run -TestPath "%LR_HOME%\scenario\memory_leak_crash.lrs"
 -ResultName C:\Temp\LR_Res\result%%i 

Result is: 


Well, where to use execution from a command line?
It can be very useful in some cases, when you plain to:

  • run LoadRunner Controller and pass its results to LoadRunner Analysis
  • run LoadRunner scripts by schedule

Selenium Interview Questions


1) What does SIDE stand for? 

2) What is the difference between an assert and a verify with Selenium commands? 

3) What Selenium commands can be used to help debug a regexp? 

4) What is one big difference between SilkTest and Selenium, excluding the price? 

5) Which browsers can Selenium IDE be run in? 

6) If a Selenium function requires a script argument, what would that argument look like in general terms? 

7) If a Selenium function requires a pattern argument, what five prefixes might that argument have? 

8) What is the regular expression sequence that loosely translates to "anything or nothing?" 

9) What is the globbing sequence that loosely translates to "anything or nothing? 

10) What does a character class for all alphabetic characters and digits look like in regular expressions? 

11) What does a character class for all alphabetic characters and digits look like in globbing? 

12) What must one set within SIDE in order to run a test from the beginning to a certain point within the test? 

13) What does a right-pointing green triangle at the beginning of a command in SIDE indicate? 

14) How does one get rid of the right-pointing green triangle? 

15) How can one add vertical white space between sections of a single test? 

16) What Selenium functionality uses wildcards? 

17) Which wildcards does SIDE support? 

18) What are the four types of regular expression quantifiers which we've studied? 

19) What regular expression special character(s) means "any character?" 

20) What distinguishes between an absolute and relative URL in SIDE? 

21) How one access a Selenium variable would named "count" from within a JavaScript snippet? 

22) What Selenese command can be used to display the value of a variable in the log file, which can be very valuable for debugging? 

23) If one wanted to display the value of a variable named answer in the log file, what would the first argument to the previous command look like? 

24) Where did the name "Selenium" come from? 

25) Which Selenium command(s) simulates selecting a link? 

26) Which two commands can be used to check that an alert with a particular message popped up? 

27) What does a comment look like in Column view? 

28) What does a comment look like in Source view? 

29) What are Selenium tests normally named (as displayed at the top of each test when viewed from within a browser)? 

30) What command simulates selecting the browser's Back button? 

31) If the Test Case frame contains several test cases, how can one execute just the selected one of those test cases? 

32) What globbing functionality is NOT supported by SIDE? 

33) What is wrong with this character class range? [A-z] 

34) What are four ways of specifying an uppercase or lowercase M in a Selenese pattern? 

35) What does this regular expression match? 

36) regexp:[1-9][0-9],[0-9]{3},[0-9]{3}

37) What are two ways to match an asterisk within a Selenese regexp? 

38) What is the generic name for an argument (to a Selenese command) which starts with //? 

39) What Selenese command is used to choose an item from a list? 

40) How many matches exist for this pattern? 

41) regexp:[13579][02468]

42) What is the oddity associated with testing an alert? 

43) How can one get SIDE to always record an absolute URL for the open command's argument? 

44) What Selenese command and argument can be used to transfer the value of a JavaScript variable into a SIDE variable? 

45) How would one access the value of a SIDE variable named name from within a JavaScript snippet used as the argument to a Selenese command? 

46) What is the name of the type of JavaScript entity represented by the last answer? 

47) What string(s) does this regular expression match? 

48) regexp:August|April 5, 2010

49) What Selenium regular expression pattern can be used instead of the glob below to produce the same results? 

50) verifyTextPresent | glob:9512?

51) What Selenium globbing pattern can be used instead of the regexp below to produce the same results? 


Selenium Test Tool


Selenium is a set of tools that supports development of test automation for web-based applications. Selenium supports multiple browser platforms.

Selenium can be used for Functional and Performance Test Automation for web based Applications.

Selenium Components

Selenium is composed of three major tools. Each one has a specific role in aiding the development of web application test automation.

Selenium-IDE

Selenium-IDE is the Integrated Development Environment for building Selenium test cases. 

Selenium-RC (Remote Control) 

Selenium-RC allows the test automation developer to use a programming language for maximum flexibility and extensibility in developing test logic. 

Selenium-RC provides an API (Application Programming Interface) and library for each of its supported languages: HTML, Java, C#, Perl, PHP, Python, and Ruby. 

Selenium-Grid

Selenium-Grid allows the Selenium-RC solution to scale for large test suites or test suites that must be run in multiple environments. 

Supported Browsers

o Firefox 3.x, Firefox 3, Firefox 2

o IE 8, IE 7, IE 6

o Safari 4, Safari 3, Safari 2

o Opera 10, Opera 9, Opera 8

and Google Chrome


* Tests developed on Firefox via Selenium-IDE can be executed on any other supported browser via a simple Selenium-RC command line.

** Selenium-RC server can start any executable, but depending on browser security settings there may be technical limitations that would limit certain features.

Extensibility

Selenium is highly flexible. There are multiple ways in which one can add functionality to Selenium’s framework to customize test automation for one’s specific testing needs. 

Selenium-IDE allows for the addition of user-defined “user-extensions” for creating additional commands customized to the user’s needs.

Companies Written Exam Sample Paper Set -4

The following text will be used in Q.31 and Q.32. In a system designed to work out the tax to be paid: 


An employee has $4000 of salary tax free 
The next $1500 is taxed at 10% 
The next $28000 is taxed at 22% 
Any further amount is taxed at 40% 

31. To the nearest $ which of these is a valid Boundary Value 
Analysis test case? 
A. $1500 
B. $32001 
C. $28000 
D. $33501 

32. Which of these groups of numbers would fall into the same 
equivalence class? 
A. $5800; $28000; $32000 
B. $0; $200; $4200 
C. $5200; $5500; $28000 
D. $28001; $32000; $35000 

33. Which of the following is NOT a characteristic of User 
Acceptance Testing? 
A. Use of automated test execution tools. 
B. Testing performed by users. 
C. Testing against acceptance test criteria. 
D. Integration of system with user documentation. 

34. For software to be reliable it must: 
A. Be easy to maintain. 
B. Be unlikely to cause a failure. 
C. Never fail under any circumstances. 
D. Be written according to coding standards.

35. We split testing into distinct stages primarily because: 
a) Each test stage has a different purpose. 
b) It is easier to manage testing in stages. 
c) We can run different tests in different environments. 
d) The more stages we have, the better the testing. 

36. Which of the following is likely to benefit most from the use of test tools providing test capture and replay facilities? 
a) Regression testing 
b) Integration testing 
c) System testing 
d) User acceptance testing 


37. Which of the following requirements is testable? 
a) The system shall be user friendly. 
b) The safety-critical parts of the system shall contain 0 faults. 
c) The response time shall be less than one second for the specified design load. 
d) The system shall be built to be portable. 

38. Error guessing: 
a) supplements formal test design techniques. 
b) can only be used in component, integration and system testing. 
c) is only performed in user acceptance testing. 
d) is not repeatable and should not be used. 

39. Which of the following is NOT true of test coverage criteria? 
a) Test coverage criteria can be measured in terms of items exercised by a test suite. 
b) A measure of test coverage criteria is the percentage of user requirements covered. 
c) A measure of test coverage criteria is the percentage of faults found. 
d) Test coverage criteria are often used when specifying test completion criteria. 

40. In prioritising what to test, the most important objective is to:
a) find as many faults as possible.
b) test high risk areas.
c) obtain good test coverage.
d) test whatever is easiest to test.



Companies Written Exam Sample Paper Set -3

21. Which of the following is NOT part of a high level test plan?
A. Functions not to be tested.
B. Environmental requirements.
C. Analysis of Specifications.
D. Entry and Exit criteria.

22. When do you stop testing?
A. When the specified number of faults are found.
B. When the test completion criteria are met.
C. When all high and medium priority tests are complete.
D. When all statements have been executed.

23. Which of the following is least important in test
management?

A. Estimating test duration.
B. Incident Management.
C. Configuration Management.
D. De-bugging.

24. How would you estimate the amount of re-testing likely to
be required?

A. Metrics from previous similar projects.
B. Discussions with the development team.
C. Time allocated for regression testing.
D. Both A & B.

25. Which of the following statements is true of static analysis:
A. Compiling code is not a form of static analysis.
B. Static analysis need not be performed before imperative
code is executed.
C. Static analysis can find faults that are hard to find with
dynamic testing.
D. Extensive statistic analysis will not be needed if white-
Box testing is to be performed.

26. Regression testing always involves
A. Testing whether a known software fault been fixed.
B. Executing a large number of different tests.
C. Testing whether modifications have introduced adverse
side effects.
D. Using a test automation tool.

27. A field failure occurs when multiple users access a system.
Which of the following is true?

A. This is an acceptable risk of a multi-user system.
B. Insufficient functional testing has been performed.
C. This indicates an important non-functional requirement was not specified and tested.
D. It is not possible to test against such events prior to release.

28. Integration testing in the large involves:
A. Testing the system when combined with other systems.
B. Testing a sub-system using stubs and drivers.
C. Testing a system with a large number of users.
D. Combing software components and testing them in one
go.

29. Data flow analysis studies:
A. How rapidly data is transferred through a program.
B. The rate of change of data values as a program executes.
C. The use of data on paths through the code.
D. The intrinsic complexity of the code.

30. The oracle assumption is that:
A. There is some existing system against which test output
may be checked.
B. The tester knows everything about the software under
test.
C. The tester can routinely identify the correct outcome of
a test.
D. Tools are used to check the results of testing.


Companies Written Exam Sample Paper Set -2

11. A piece of software has been given….what tests in the
Following will you perform?
1) Test the areas most critical to business processes
2) Test the areas where faults will be maximum
3) Test the easiest functionalities


A. 1&2 are true and 3 is false.
B. 1,2&3 are true.
C. 1 is true, 2&3 are false.
D. 1&2 are false, 3 is true.

12. Amount of testing performed will not depend on
A. Risks involved
B. Contractual requirements
C. Legal requirements
D. Test data.

13. Which of the following provides the biggest potential cost
saving from use of CAST?

A. Test management
B. Test design
C. Test planning
D. Test execution

14. Testing is not done to ….
A. Find faults
B. Improve quality
C. Check user friendliness.
D. Improve software accuracy

15. Software quality is not relevant to …
A. Correctness
B. Usability
C. Viability
D. Reusability.

16. Which of the following are false?
A. Incidents should always be investigated and resolved.
B. Incidents occur when expected and actual results differ.
C. Incidents can be analyzed to assist in test process improvement.
D. An incident can be raised against documentation.

17. Which of the following is a type of non-functional testing?
A. Usability testing.
B. Statement Coverage.
C. Dataflow testing.
D. Cause-effect graphing.

18. To make a test effective it is most important that: A. It is easy to execute.
B. It is designed to detect faults if present.
C. The expected outcome is specified before execution.
D. It is unlikely to delay progress.

19. Error guessing is:
A. An appropriate way of deriving system tests.
B. Only used if good requirements are not available.
C. Only used when good requirements are available.
D. The most appropriate way of deriving system tests.

20. Which of the following is true of V-model?
A. It includes the verification of designs.
B. It states that modules are tested against user
requirements.
C. It specifies the test techniques to be used.
D. It only models the testing phase.



Companies Written Exam Sample Paper Set -1

1. What is failure?
A. Deviation from expected result to actual result
B. Defect in the software.
C. Error in the program code.
D. Fault in the system.

2. People who don’t participate in technical reviews
A. Analysts
B. Management
C. Developers
D. Testers

3. What type of testing is done to supplement the rigorous testing?
A. Regression testing.
B. Integration testing.
C. Error Guessing
D. System testing.

4. Capture and replay facilities are least likely to be used to ….
A. Performance testing
B. Recovery testing
C. GUI testing
D. User requirements.

5. If a candidate is given an exam of 40 questions, should get 25 marks to pass (61%) and should get 80% for distinction, what is equivalence class? A. 23, 24, 25
B. 0, 12, 25
C. 30, 36, 39
D. 32, 37, 40

6. Match the following:
1. Test estimation
2. Test control
3. Test monitoring

a. measures of tracking process
b. effort required to perform activities
c. reallocation of resources

A. 1-b, 2-c, 3-a
B. 1-b, 2-a, 3-c
C. 1-c, 2-a, 3-b
D. 1-a, 2-b, 3-c

7. Which of the following is not included in Test Plan?
A. Features to be tested.
B. Environmental needs.
C. Suspension criteria.
D. Expected results.

8. Cost of the reviews will not include.
A. Review process itself
B. Metrics analysis
C. Tool support.
D. Process improvement.

9. What type of testing will you perform on internet banking
solution?

A. System integration
B. Functional testing
C. Non-functional testing.
D. Requirements testing

10. Which tool will be used to test the flag memory leaks and
unassigned pointers

A. Dynamic analysis tool
B. Static Analysis tool
C. Maintenance tool.
D. Configuration tool.



GUI Testing


GUI testing is a process to test application's user interface and to make sure that it confirms the design requirements.


1. Text Box
a. Move the Mouse Cursor over all Enter able Text Boxes. Cursor should change from arrow to Insert Bar.
b. If it doesn't then the text in the box should be grey or non-update-able.
c. Try to overflow the text by typing to many characters.
d. Enter invalid characters - Letters in amount fields, try strange characters like + , - * etc. in All fields.
e. SHIFT and Arrow should Select Characters. Selection should also be possible with mouse. Double Click should select all text in box.
 

2. Radio Button:
Left and Right arrows should move ON Selection. So should Up and Down. Select with mouse by clicking.
Check Boxes: Clicking with the mouse on the box, or on the text should SET/UNSET the box. SPACE should do the same.
 

3. Command Buttons
a. If Command Button leads to another Screen, and if the user can enter or change details on the other screen then the Text on the button should be followed by three dots.
b. All Buttons except for OK and Cancel should have a letter Access to them. This is indicated by a letter underlined in the button text. The button should be activated by pressing ALT+Letter. Make sure there is no duplication.
c. Click each button once with the mouse - This should activate
Tab to each button - Press SPACE - This should activate
Tab to each button - Press RETURN - This should activate
d. If there is a Cancel Button on the screen , then pressing should activate it.
 

4. Aesthetic Conditions:
a. Is the general screen background the correct colour?
b. Are the field prompts the correct colour?
c. Are the field backgrounds the correct colour?
d. In read-only mode, are the field prompts the correct colour?
e. In read-only mode, are the field backgrounds the correct colour?
f. Are all the screen prompts specified in the correct screen font?
g. Is the text in all fields specified in the correct screen font?
h. Are all the field prompts aligned perfectly on the screen?
i. Are all the field edit boxes aligned perfectly on the screen?
j. Should the screen be resizable?
k. Should the screen be minimisable?
l. Is all user input captured in UPPER case or lower case consistently?
 

5. Validation Conditions:
a. Does a failure of validation on every field cause a sensible user error message?
b. Is the user required to fix entries which have failed validation tests?
c. Have any fields got multiple validation rules and if so are all rules being applied?
d. If the user enters an invalid value and clicks on the OK button (i.e. does not TAB off the field) is the invalid entry identified and highlighted correctly with an error message.?
e. Is validation consistently applied at screen level unless specifically required at field level?
f. For all numeric fields check whether negative numbers can and should be able to be entered.
g. For all numeric fields check the minimum and maximum values and also some mid-range values allowable?
h. For all character/alphanumeric fields check the field to ensure that there is a character limit specified and that this limit is exactly correct for the specified database size?
i. Do all mandatory fields require user input?
j. If any of the database columns don't allow null values then the corresponding screen fields must be mandatory. (If any field which initially was mandatory has become optional then check whether null values are allowed in this field.)

6. Usability Conditions:
a. Is all date entry required in the correct format?
b. When an error message occurs does the focus return to the field in error when the user cancels it?
c. Do all the fields edit boxes indicate the number of characters they will hold by there length? e.g. a 30 character field should be a lot longer

7. Data Integrity Conditions:
a. Check the maximum field lengths to ensure that there are no truncated characters?
b. Check maximum and minimum field values for numeric fields?
c. If numeric fields accept negative values can these be stored correctly on the database and does it make sense for the field to accept negative numbers?

8. Date Field Checks
a. Assure that leap years are validated correctly & do not cause errors/miscalculations
b. Assure that month code 00 and 13 are validated correctly & do not cause errors/miscalculations
c. Assure that 00 and 13 are reported as errors
d. Assure that day values 00 and 32 are validated correctly & do not cause errors/miscalculations
e. Assure that Feb. 28, 29, 30 are validated correctly & do not cause errors/ miscalculations
f. Assure that Feb. 30 is reported as an error
g. Assure that century change is validated correctly & does not cause errors/ miscalculations

9. Alpha Field Checks
a. Use blank and non-blank data
b. Include lowest and highest values
c. Include invalid characters & symbols
d. Include valid characters
e. Include data items with first position blank
f. Include data items with last position blank

Test Case for E-Commerce Site (login)

LOGIN-1: Normal User Login
Purpose:
Test that users can log into the system with the proper user ID and password.
Prerequisites:
User is not logged into the system. The user account ‘test.user’ exists and is in good standing.
Test Data:
User ID
test.user
Password
testing4U
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is logged into the user administration page.
Post-Test:
6. Click the Logout button.
Notes and Questions:

LOGIN-2: Invalid User ID
Purpose:
Test that a user receives an error message when they attempt to log into the system with an invalid User ID.
Prerequisites:
User is not logged into the system. The user account ‘test.user’ exists and is in good standing.
Test Data:
User ID
bad.userId
Password
testing4U
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is returned to the login screen.
6. An error message is displayed to the user stating ‘invalid Login credentials.’
Post-Test:
7. Click the Logout button.
Notes and Questions:


LOGIN-3: Invalid Password
Purpose:
Test that a user receives an error message when they attempt to log into the system with an invalid Password.
Prerequisites:
User is not logged into the system. The user account ‘test.user’ exists and is in good standing.
Test Data:
User ID
test.user
Password
testing
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is returned to the login screen.
6. An error message is displayed to the user stating invalid Login credentials.’
Post-Test:
7. Click the Logout button.
Notes and Questions:

LOGIN-4: Required Fields Not Entered
Purpose:
Test that users receive error messages when required fields are not entered in the Login form.
Prerequisites:
User is not logged into the system.
Test Data:
User ID
Password
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is returned to the Login page.
6. An error message is displayed for each required field stating ‘<FIELD NAME> is required.’
Post-Test:
7. Click the Logout button.
Notes and Questions:

LOGIN-5: Reset Button
Purpose:
Test that the Reset button on the Login page resets the form to its original state.
Prerequisites:
User is not logged into the system.
Test Data:
None
Steps:
1. Visit Login page.
2. Click the Reset button.
Verify Results:
3. The user is returned to the Login page.
4. All fields in the form are reset to their original state.
Post-Test:
5. Click the Logout button.
Notes and Questions:

Test Case for E-Commerce Site (Validation)



Field Input - 1: Maximum Length UserId
Purpose:
Test that users can only put in a maximum length of characters for input fields.
Prerequisites:
User is not logged into the system. The user account ‘test.user’ exists and is in good standing.
Test Data:
User ID
Put over 40 Characters.
Password
testing4U
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user will receive an Error message “User ID must have a maximum length of 40”
Post-Test:
Notes and Questions:

Field Input - 2: Maximum Length Password
Purpose:
Test that users can only put in a maximum length of characters for input fields.
Prerequisites:
User is not logged into the system. The user account ‘test.user’ exists and is in good standing.
Test Data:
User ID
test.user
Password
Put over 20 Characters.
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user will receive an Error message “Password must have a maximum length of 20”
Post-Test:
Notes and Questions:

Test Case for E-Commerce Site (Security)


SECURITY-1: Administrator User Role
Purpose:
Test that an administrator user can log into the system and access only the link page for system administrators.
Prerequisites:
User is not logged into the system. The administrator user account exists in good standing and is setup with a administrator role.
Test Data:
User ID
admin.role
Password
testing4U
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is directed to the administrative link page.
Post-Test:
6. Click the Logout button.
Notes and Questions:

SECURITY-2: Client User Role
Purpose:
Test that a customer user with a customer role can log into the system and access only the customer order page.
Prerequisites:
User is not logged into the system. The customer user account exists in good standing and is setup with a customer role.
Test Data:
User ID
customer.role
Password
testing4U
Steps:
1. Visit Login page.
2. Enter the User ID stated above.
3. Enter the Password stated above.
4. Click the Submit button.
Verify Results:
5. The user is directed to the customer order page.
Post-Test:
6. Click the Logout button.
Notes and Questions:



Software Testing Dictionary - 10


Table testing. Test access, security, and data integrity of table entries. [William E. Lewis, 2000]

Test Bed. An environment containing the hardware, instrumentation, simulators, software tools, and other support elements needed to conduct a test [IEEE 610].

Test Case. A set of test inputs, executions, and expected results developed for a particular objective.

Test conditions. The set of circumstances that a test invokes. [Daniel J. Mosley, 2002]

Test Coverage The degree to which a given test or set of tests addresses all specified test cases for a given system or component.

Test Criteria. Decision rules used to determine whether software item or software feature passes or fails a test.

Test data. The actual (set of) values used in the test or that are necessary to execute the test. [Daniel J. Mosley, 2002]

Test Documentation. (IEEE) Documentation describing plans for, or results of, the testing of a system or component, Types include test case specification, test incident report, test log, test plan, test procedure, test report.

Test Driver A software module or application used to invoke a test item and, often, provide test inputs (data), control and monitor execution. A test driver automates the execution of test procedures.

Test Harness A system of test drivers and other tools to support test execution (e.g., stubs, executable test cases, and test drivers). See: test driver.

Test Item. A software item which is the object of testing.[IEEE]
Test Log A chronological record of all relevant details about the execution of a test.[IEEE]

Test Plan.A high-level document that defines a testing project so that it can be properly measured and controlled. It defines the test strategy and organized elements of the test life cycle, including resource requirements, project schedule, and test requirements

Test Procedure. A document, providing detailed instructions for the [manual] execution of one or more test cases. [BS7925-1] Often called - a manual test script.

Test Rig A flexible combination of hardware, software, data, and interconnectivity that can be configured by the Test Team to simulate a variety of different Live Environments on which an AUT can be delivered.[Testing IT: An Off-the-Shelf Software Testing Process by John Watkins ]

Test strategy. Describes the general approach and objectives of the test activities. [Daniel J. Mosley, 2002]

Test Status. The assessment of the result of running tests on software.

Test Stub A dummy software component or object used (during development and testing) to simulate the behaviour of a real component. The stub typically provides test output.

Test Suites A test suite consists of multiple test cases (procedures and data) that are combined and often managed by a test harness.

Test Tree. A physical implementation of Test Suite. [Dorothy Graham, 1999]

Testability. Attributes of software that bear on the effort needed for validating the modified software [ISO 8402]

Testability Hooks. Those functions, integrated in the software that can be invoked through primarily undocumented interfaces to drive specific processing which would otherwise be difficult to exercise. [Scott Loveland, 2005]

Testing. The execution of tests with the intent of providing that the system and application under test does or does not perform according to the requirements specification.

(TPI) Test Process Improvement. A method for baselining testing processes and identifying process improvement opportunities, using a static model developed by Martin Pol and Tim Koomen.

Thread Testing. A testing technique used to test the business functionality or business logic of the AUT in an end-to-end manner, in much the same way a User or an operator might interact with the system during its normal use.[Testing IT: An Off-the-Shelf Software Testing Process by John Watkins ]


Timing and Serialization Problems. A class of software defect, usually in multithreaded code, in which two or more tasks attempt to alter a shared software resource without properly coordinating their actions. Also known as Race Conditions.[Scott Loveland, 2005]