test case in Manual mode

Test case creation in manual mode

Last updated on

In this tutorial, we are going to learn, test script creation using Katalon Studio’s manual mode. As stated in our previous tutorials, Katalon studio inherently supports Keyword-driven framework. Katalon has a rich set of keywords or we can say commands to help in test case creation for users with limited programming knowledge. Users can directly use these keywords to simulate some user actions like opening a browser or to perform some tasks like validating if the expected and actual results are the same. Let’s first see some commonly used keywords provided by Katalon Studio for automating a web application.

Browser related keywords

KeywordDescription
Open BrowserOpens browser with the URL provided, if no URL is provided then it will just open a blank browser.
Close BrowserCloses a browser.
Navigate to UrlNavigates to a url provided in the Input cell.
Delete All CookiesDeletes browser cookies.
Wait For Page LoadWaits for page to load with the timeout value in seconds.
RefreshRefreshes the browser.
BackGoes back to the previous URL in the browser history.
ForwardGoes to the next URL in the browser history.

Web element related keywords

KeywordDescription
ClickSimulates mouse left-click on a web element.
Double ClickSimulates mouse double-click on a web element.
Right ClickRight clicks on a web element.
CheckChecks a check-box or radio button.
Un-checkUnchecks a check-box or radio button.
Set TextWrites a text on a textbox or any input field (similar to sendKeys() in selenium)
Select Option By IndexSelects a dropdown option by its index.
Select Option By LabelSelects a dropdown option by its visible text.
Select Option By ValueSelects a dropdown option by its value.

Common wait related keywords

KeywordDescription
Wait For Element ClickableWaits for an element to be clickable with timeout value in seconds.
Wait For Element VisibleWaits for an element to be visible with timeout value in seconds.
Wait For Element Not VisibleWaits till an element is not visible.

Commonly used validation related keywords

KeywordDescription
Verify Element PresentReturns a boolean value of true/false based on the presence of an element.
Verify Element Not PresentReturns a boolean value of true/false based on the absence of an element.
Verify Element TextReturn true if the element’s text is the same as expected text else false.
Verify EqualReturn true if the actual value is the same as the expected value.
Verify Not EqualReturn false if the actual value is the same as the expected value.

Other commonly used keywords

KeywordDescription
Accept AlertSimulates user action of accepting an alert or clicking ‘Ok’ on an alert dialog box.
Dismiss AlertSimulates user action of dismissing an alert or clicking ‘Cancel’ on an alert dialog box.
Get AttributeUsed to get a particular attribute of a web element e.g. name, type etc.
Get TextUsed to get the element text.
Drag And Drop To ObjectSimulates drag and drop action.
Switch To FrameSwitches to a particular iframe.
Switch To Window TitleSwitches to a particular window with the given title.
Close Window TitleReturn false if the actual value is same as expected value.
Switch To Default ContentSwitches to the parent window, called after performing some function on an iframe or a different window/tab.
Take ScreenshotTakes a screenshot of the browser when called.
Execute JavaScriptUsed to execute javascript command.
Upload FileUsed to perform file upload operation on a file type element.

Now, let’s begin with a test script creation using Katalon’s manual mode. In this demo, we will create a test that checks Google calculator functionality.
Let’s first quickly see, how to create a project in Katalon.

  1. On the Katalon Studio IDE, go to the File menu and click on New->Project.
  2. Name your Project, specify the project location, provide a description(optional) and click OK. Now, the “Test Explorer” on the left-hand side will get populated with pre-defined packages like ‘Test Cases’, ‘Object Repository’, ‘Test Suites’, ‘Data Files’ etc.
  3. Next, we need to create a test case. For this, right-click on ‘Test Cases’, click on the New button on the toolbar and select Test Case. Name your test case – ‘GoogleCalc’, provide a description and click OK. If everything is fine, the following screen will be displayed.

Now that we know, how to create a project on Katalon, let’s focus on the test case creation part. We can create tests in the Manual mode by adding keyword using Add button. For keywords related to web application automation, click on the arrow icon in the Add button and select Web UI Keyword option.

When dealing with web elements we need to capture or locate the elements. For this, we can use Spy Web feature. Clicking the Spy Web option launches an Object Spy window where we can pass the URL of the application. After passing the URL and clicking Start link, the browser launches with the given URL. Now we can hover over any element and pressing Alt+` will save the object in the object repository.

Google calculator test in manual mode

  • Select Open browser from the Web UI Keyword, leaving the Input cell blank, in order to launch a browser.
  • For opening a URL, select Navigate To URL keyword with the exact URL in the Input cell – https://google.com.
  • Now, using object spy, capture the locator for the google search box.
  • For writing into the search box, select Set Text option, in the Object cell enter the name of the object captured (you can also drag and drop the object from the Object Repository into the Object cell). The arithmetic operation e.g. 2+2 will be entered in the Input cell.
  • Next, add a Click keyword on the Google Search button(Google search button present in the auto-suggestion for 2+2).

Now we just need to add an Assertion or validation point which checks that the result of 2+2 is getting correctly calculated as ‘4’. For this, we will use “Validate element text” keyword. Now, double-click Input cell corresponding to “Verify Element Text” action and enter ‘4’ in the ‘Value’ cell.

  • For closing the browser, select the Close Browser keyword.

This completes the test script creation part. Now, we can execute our test script by clicking the ‘Run’ button. You can see the test steps getting executed in the selected browser and the result of the test as passed. Also, you can change the expected value to ‘5’ instead of the correct value ‘4’ and run the test to see it getting failed.
This concludes our post on test script creation using manual mode feature. In the next tutorial, we will study the creation of test script in script mode of Katalon Studio.

Leave a Comment