View
215
Download
0
Category
Preview:
Citation preview
Test Automation For Web-Based Applications
Portnov Computer SchoolPortnov Computer School
Presenter: Ellie Skobel
2
Day 1
Practice Test Cases
Open Firefox browserNavigate to
http://hrm.tehportal.net (*1) Go to Tools Selenium IDE (*2)
3
*2
The Record button is ON by
default
*1
Steps:◦ Login:
username: admin password: Password
◦ Go to PIM > Employee List◦ Search by Job Title for “QA Manager”◦ Verify that the search returns “QA Manager” and
does not return QA Engineer or Software Development Manager.
◦ Play back the test and debug until all commands pass (green color)
4
Open Selenium IDE and ensure recording is ‘ON’
Make sure you substitute click command with clickAndWait command wherever needed. (Hint: When a ‘click’ causes the web page to reload)
Use assertNotText command To assert that specified text is not displayed in the
specific HTML element
5
Manual Test-Case Automated Test-Case
Test-Case Objective Ensure search by “job” functions as expected
Steps 1) Login2) View the Employee List3) Search by Job Title for “QA
Manager”4) Check the search result5) Log outExpected Result1) The search returns only
managers, and no other employees
6
Steps:◦ Login:
username: admin password: Password
◦ Click PIM ◦ Click Add button (green button)◦ Provide First and Last name for the new employee◦ Click Save button◦ On the Personal Details page click the Edit button◦ Verify Middle Name field is editable◦ Enter a new Middle Name and click Save button◦ Verify the fields are NOT editable◦ Logout and Stop recording◦ Play back the test and debug until all commands pass (green color)
7
If the command you are trying to find is not available through the context menu, then select ‘Show All Available Commands” at the bottom of the context menu.
If the command is still not available, then select a similar command to allow Selenium IDE to record the required parameters and after you finished recording, you can manually change the command.
8
Use assertEditable command To ensure a field is enabled and editable
Use assertValue command If the text of the specific webpage element
not embedded between tags, but is specified inside the tag instead
<td>TEXT</td> use assertText<input value=“TEXT”> use assertValue
9
Manual Test-Case Automated Test-Case
Test-Case Objective Ensure new employee is added to employee list
Steps 1. Login using login: admin & password: password2. Select PIM > Add Employee menu item3. Provide First and Last name for the new
employee4. Click Save button5. On the Personal Details page click the Edit button6. Assert the fields are editable7. Enter a new Middle Name 8. Click Save button9. Assert the fields are NOT editable10. Assert the Middle Name was saved11. Logout
Expected Result1) Employee Details can be edited and saved
10
11
Use storeValue command (not storeText) To store the automatically generated employee id in a variable
To use in your code the value stored in a variable, place the variable name in curly brackets with $ sign in front: ${variable_name}Selenium will replace ${variable_name} with the value/text stored within the variable
Find the line in which you manually entered the employee code. Replace the value you entered with ${variable_name}
12
Manual Test-Case Automated Test-Case
Test-Case Objective New employee can be found through search by Emp ID
Steps 1. Login 2. Add new employee3. Provide First and Last name and
store the automatically generated employee code
4. Perform a search by Emp ID for the stored employee code
Expected Result1) The search returns only one
employee with the correct name
13
Recommended