In Opkey, you can efficiently create and manage both automated test cases in the Automate section. This section is specifically designed to cater to the needs of Testers and QAs, providing a centralized hub to oversee all test cases and their associated test data.
For example, let's say you need to test a validating user login scenario in an ERP system. With Opkey's recorder, you can quickly create an automated test case by capturing actions such as entering credentials. You can also use keywords to add steps to sign out from the application.
In this article, we will create and execute a test case for testing signing-in and signing-out functionality on a demo web application.
1. Hover over the Automate section and click Test.
2. Click the Create Test button to select Automated Test Case.
3. The "Create Test Case" window opens on the right. Fill in information such as Name, Priority, and Description, and choose an Assignee. You can also add attachments like spreadsheets, videos, images, etc., to this test case. Once done, click the Create button at the bottom.
4. Now, to add steps in the empty test case, click on the "Recorder" option.
5. Select "Web" recorder as we are testing a web application, and click "Start Recording" to begin the recording process.
6. The Opkey recorder window and a default web page open up. Enter the URL and use the login credentials to sign in to the web page.
7. In the recorder window, you can see the corresponding steps getting recorded with their object details. We can scroll down on the window to look at all the object properties of the selected step.
For example, in the image below, we can see the related "Username" object with its screenshot captured from the test application.
8. When the objects are recorded by the Opkey recorder, the recorded objects get named based on the properties of the objects. These names can sometimes not provide much clarity or detail about the things they refer to. To avoid such scenarios we can change the object's name during recording itself. The object's name can be edited in the field shown in the image below.
Note: Once you Save and Close the recorder window, the steps are saved in the test cases and an object repository is created by the name of the test case. You can use objects saved in the repository in other test cases.
9. Once done, click on the "Stop and Save" button and click Yes on the pop-up that follows.
10. Now, you can see the test steps are added in the test case. Save these steps.
11. Now to enhance this test case further by adding a test step with a keyword, select the last step and click on the Add Step button at the top to add a new step after it. Search the ClickButton keyword and click on its search result.
12. Click Dynamic Object for the ClickButton step. The dynamic object possesses changing object properties. In this example, we aim to locate the Sign Out button on the webpage. Add Sign Out as the value for the logical name and TextToSearch parameters in the dynamic object property.
This will enable Opkey to locate the Sign Out button using these object properties and proceed with the step. Finally, click the back icon at the top and close the input data window.
Now, let's execute this test case.
1. Save the test case and click the Run icon. Select Run on Browser.
2. Provide a run name and select the desired browser.
3. Run Wizard Opens up. Add a name for the test run and select the milestone to link it. Here, you can also select the browser to run the test case.
Note: If you've specified a browser name in your test case, the execution will use that browser. This happens even if you choose a different browser in the Run Wizard window.
For example, if you have specified Microsoft Edge browser in the first step of test case but selected Chrome browser in the Run Wizard window, then the test case will execute in the Edge browser as specified in the test case.
4. Click on Advanced Settings to add a build name, select the agent, and click Start Run to begin the execution.
Note: If you are a Mac device user, select Agent Spock to execute the test. Use Opkey Execution Agent to execute test cases on a Windows device.
5. In the Advanced Setting tab, you get the option to choose from the two available options:
Use Suggested plugin - This lets you add the test case-specific plugin.
Last used plugin - This lets you select the last used plugin for execution.
6. Under the More Settings tab, you get the options of:
Update mapped data steps: This helps update the mapped data in the current steps.
Skip empty data steps: This helps skip the empty datasets in a test case.
Randomize input default value: It allows data to be picked randomly from either the local datasheet or the global datasheet.
Highlight Object: This helps to highlight the objects during execution
Perform a Visibility check: It first checks whether the object is present in the application.
Enable Step Logs: This helps generate step logs after execution.
7. If you want to view the executions on the remote machine, click on the View Live Run button.
This feature is particularly useful for executing test cases across multiple virtual machines, eliminating the need to manually log in each time you want to view the results or their status.
Note: To continue working with the Live run feature, please take a look at the pre-requisite document.
8. Once the execution is completed, click "View Result" to analyze the test case results.
9. Here we can see our result.
You've reached the end of this article and are now well-prepared to create and execute automated test cases.
Ready to dive deeper? Check out the next article: Creating Reusable Components.
Explore, experiment, and achieve your testing goals on Opkey!
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article