Diese Präsentation wurde erfolgreich gemeldet.
Die SlideShare-Präsentation wird heruntergeladen. ×

Test Case Creation in Katalon Studio

Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
Anzeige
1
Test Case Creation in Katalon Studio
Problem Statement
How to Create a Test Case
Test Case Execution in Katalon Studio
How to Create a Test Case in Katalon Studio
A Katalon Studio user can create a Test ...
Test Case Execution in Katalon Studio
Also, the Test Case can be created directly from the Tests Explorer section by a rig...
Anzeige
Anzeige
Anzeige
Wird geladen in …3
×

Hier ansehen

1 von 15 Anzeige

Weitere Verwandte Inhalte

Diashows für Sie (20)

Anzeige

Weitere von RapidValue (20)

Aktuellste (20)

Anzeige

Test Case Creation in Katalon Studio

  1. 1. 1 Test Case Creation in Katalon Studio Problem Statement How to Create a Test Case
  2. 2. Test Case Execution in Katalon Studio How to Create a Test Case in Katalon Studio A Katalon Studio user can create a Test Case from File > New > Test Case. (screenshot below) A new window will pop up (as shown below), and the user can provide the Name and Description of the Test Case. Then, an empty Test Case will be created, and it will be displayed in the Test Cases folder in Tests Explorer section. @RapidValue Solutions Page 2
  3. 3. Test Case Execution in Katalon Studio Also, the Test Case can be created directly from the Tests Explorer section by a right click on the Test Cases Folder. Then, you click New > Test Case. (figure shown below) @RapidValue Solutions Page 3
  4. 4. Test Case Execution in Katalon Studio The modes of Test Case execution can be explained with the help of a sample test case, which is explained below. Sample Test Case (Steps): 1. Navigate to URL “https://katalon-demo-cura.herokuapp.com/” 2. Click on “Make Appointment” button 3. Enter username and password, and click Login button 4. Select facility as “Seoul CURA Healthcare Center” 5. Enter any date in visit date field 6. Click “Book Appointment” button The expected result is that the user should get an appointment confirmation. Modes of Test Case Creation There are 3 ways to create automation test in Katalon Studio. 1. Record and Replay: This mode allows the user to create the test by recording the script and you can replay the same by clicking the Run button 2. Manual Mode: Katalon Studio has numerous built-in keywords, and this mode allows the user, with less experience in programming, to perform an action by using these built-in keywords. 3. Script Mode: This mode allows the users, with good programming knowledge, to create test cases. Here, the Automation Engineer can use the programming languages like Groovy or Java to create and edit the test scripts. All the 3 modes allow the user to add or edit the test case and prepare final automated test. @RapidValue Solutions Page 4
  5. 5. Test Case Execution in Katalon Studio 1) Record and Replay: Firstly, the user needs to create a Test Case (user can use any of the method which was described earlier). Then, a new window would open after clicking on the Record Web button (Screenshot below). The window has a field called URL, and the user needs to provide the application URL in this field. Beside the URL field, a button should be displayed, where the user can select the required browser from the drop down. Once after the button is clicked, a new browser instance should be opened. The user can perform the steps mentioned in the sample Test Case, and all the user activities will be recorded in the background. Then, the window should look like: @RapidValue Solutions Page 5
  6. 6. Test Case Execution in Katalon Studio Finally, the user needs to validate the expected result with the actual result. For validation, at first the user needs to identify an object in the Final landing Page, and perform any action with that particular object. Then the user needs to click on the Add button, and then a new tab will be added in the 11th row (as per the sample test case).The user needs to enter the keyword “verify”, then a number of verify keywords will get listed, and from that list the user can select the needed validation. For the verification item, the object can be added in the object field. @RapidValue Solutions Page 6
  7. 7. Test Case Execution in Katalon Studio Once after the user clicks OK, then Katalon will ask the user to add the elements to the object repository. Here, the user will get the privilege to select the elements which should be added to the object repository. Instead of the default object repository, user gets a chance to create a new folder as well, to store the elements. Now, the test case is ready, and the user can save it. For replaying, the user needs to click on the Run button. Here also, the user will get the privilege to select the required browser from the drop down. 2) Manual Mode: This mode allows users, with less programming knowledge, to generate and execute the automation test easily. Firstly, the user should capture the objects to be used in the test. In order to achieve that a spy web button is available in Katalon Studio. Once after clicking the spy web button, a new Object Spy window will get opened. Here, the user can put the URL under test in the URL field. @RapidValue Solutions Page 7
  8. 8. Test Case Execution in Katalon Studio The user can capture the object by clicking on the mouse, and then he/she needs to press ALT +.` Then, the user needs to identify all the objects which are needed to complete the automation test. Once after the user completes adding the objects, then he/she needs to save the objects into the Object Repository. In order to achieve this, a Save button is available in the object spy window. Once the user clicks on the Save button, the window shown below would pop up which helps the user to add the objects to Object Repository. @RapidValue Solutions Page 8
  9. 9. Test Case Execution in Katalon Studio Here, the user gets the privilege to check and uncheck the needed and unwanted objects. Also, the user will be able to add a new folder if needed. Then, the OK button can be clicked. Once the OK button is clicked, the user is able to see all the objects in the object repository in the Tests Explorer. There are other ways as well to capture objects by inspecting the element from the browser. Secondly, the user needs to create a Test Case (user can follow any of the methods which are described before). By default, the test case will be opened in the manual mode. This allows users to develop the scripts easily with very little programming knowledge. Select Add > Web UI Keyword from the command toolbar. Then, select the keywords to perform the action. @RapidValue Solutions Page 9
  10. 10. Test Case Execution in Katalon Studio This can be explained with the help of the previously mentioned sample Test Case. 1. To open a browser, add the Open Browser. 2. To navigate to a specified URL, add the Navigate To Url keyword. Double click on the Input cell to provide additional data (parameters) for the keyword. The Input dialog is displayed as below. Each row represents one parameter. For now, enter the URL of Katalon demo AUT into the Value column, and then click OK. Here, Param Name is the name of the parameter; Param Type is the data type of the parameter (e.g. String, Variable or Test Data Value); Value Type is the type of input value (e.g. String, Variable or Test Data Value) and Value is the input value for this parameter. Input value varies depending on the specified Value Type. 3. To click on an object, add the Click keyword and then the user needs to associate the keyword with an object. Double click on the object field to provide the appropriate object from the object repository. @RapidValue Solutions Page 10
  11. 11. Test Case Execution in Katalon Studio 4. To perform the sendkeys action, add the Set Text keyword, and then associate the keyword with the appropriate object. Double click on the Input cell and provide the input text in the value field. 5. To select a value from the drop down, Katalon provides 3 keywords namely: (i) Select Option By Index: Select the option at the given index. Index starts from 0. (ii) Select Option By Value: Select the options with the given value. (iii) Select Option By Label: Select the options with the given label (displayed text). 6. For verifying the element, add the Verify Element Present keyword which validates if the given web element is present on DOM. Here, the user needs to associate the keyword with an object. Double click on the object field to provide the appropriate object from the object repository. At last, the window will look like the one below (after following the test case) and the user needs to save the test case, and then click on Run in the main toolbar to execute the test case. 3) Script Mode: Katalon Studio allows expert users to programmatically write and execute automation test in the Script mode. At first, the user needs to create a Test Case (as mentioned earlier, the user can follow any of the steps mentioned before to create a test case). @RapidValue Solutions Page 11
  12. 12. Test Case Execution in Katalon Studio Once a new test case is created, the user can switch to the Script mode using the corresponding tab at the footer of the test case editor. The user can find some import statements, which belongs to some default packages. The user can start writing the test by using the package WEBUI. This is the package of Katalon Studio which has all the in-built keywords. Once the user enters the dot character after the package WEBUI, he/she will be able to find a number of suggestions for code completion. @RapidValue Solutions Page 12
  13. 13. Test Case Execution in Katalon Studio This mode of test case execution can be explained with the help of the previously mentioned sample Test Case. 1. To open the browser, use the keyword openBrowser. This keyword helps the user to open browser and navigate to the specified URL; if URL is left empty then just open browser. 2. To navigate to a specified URL, use the keyword navigateToUrl. Here, the user needs to pass the URL as a parameter. If the URL doesn't contain protocol prefix, then the protocol will be http://. 3. To click on an object, use the keyword click and you need to pass the Test Object parameter. To pass the object, the user can directly drag and drop the object from object repository to the parameter field. 4. To perform the set text operation, use the keyword setText. Here, the parameters that a user should pass are the object ID and the text. The user can drag and drop the object to the object field. 5. To select a value from the drop down, Katalon provides 3 keywords (which are mentioned in the manual mode description). 6. To perform the verification, the user can use the verified keywords. To cite an example, if the user needs to verify that an element is present, user can use the keyword verifyElementPresent. Here, the user needs to pass the parameters like object ID and wait time. The script mode window will look like the one below (after following the test case) and the user needs to save the test case, and then click on Run in the main toolbar to execute the test case. @RapidValue Solutions Page 13
  14. 14. Test Case Execution in Katalon Studio Conclusion This concludes the article on test case creation using Katalon Studio. Hope this could help you to gather some useful information about the 3 different modes of creating Test Case in Katalon Studio. In the upcoming blogs, there will be more focus on the Test Suite Creation and the Report generation in Katalon Studio. Happy Learning! By, Kiran M G, Senior Software Test Engineer. @RapidValue Solutions Page 14
  15. 15. Test Case Execution in Katalon Studio About RapidValue RapidValue is a global leader in digital product engineering solutions including mobility, omni-channel, IoT, AI, RPA and cloud to enterprises worldwide. RapidValue offers its digital services to the world’s top brands, Fortune 1000 companies and innovative emerging start-ups. With offices in the United States, the United Kingdom, Germany and India and operations spread across the Middle-East, Europe and Canada, RapidValue delivers enterprise services and solutions across various industry verticals. Disclaimer: This document contains information that is confidential and proprietary to RapidValue Solutions Inc. No part of it may be used, circulated, quoted, or reproduced for distribution outside RapidValue. If you are not the intended recipient of this report, you are hereby notified that the use, circulation, quoting, or reproducing of this report is strictly prohibited and may be unlawful. @ RapidValue Solutions www.rapidvaluesolutions.com/blogwww.rapidvaluesolutions.com +1 877.690.4844 contactus@rapidvaluesolutions.com @RapidValue Solutions Page 15

×