Table of contents
1.
Introduction
2.
Proxy Preferences
2.1.
What are proxy servers?
2.2.
Proxy Server in Katalon
2.2.1.
Proxy Option
2.2.2.
Proxy Server Type
2.2.3.
Address and Port
2.2.4.
Excludes
2.2.5.
Authentication
2.2.6.
Auto Apply to Desired Capabilities
3.
Test Case Preferences
3.1.
Test Case Calling
3.2.
Default Open View
3.3.
Default Keyword Type
3.4.
Line Wrap
4.
Mobile Preferences
5.
Frequently Asked Questions
5.1.
Line wrapping isn't working for me, what should I do?
5.2.
Are there free proxy servers available too?
5.3.
What happens if I set proxyType as manual, and connect via FTP without providing an ftpProxy value?
6.
Conclusion
Last Updated: Mar 27, 2024

Proxy and Test Case Preferences in Katalon Studio

Author Satvik Gupta
0 upvote
Career growth poll
Do you think IIT Guwahati certified course can help you in your career?

Introduction

Katalon is a quality management platform. It's mainly used for automated testing. We can perform the entire cycle of testing software in Katalon. It has features for planning, managing, and performing tests. We can also analyze the results, scale and collaborate with our team members.

Proxy and Test Case Preferences in Katalon

Katalon allows us to manage Preferences so that users can use it in their own way. We can configure general and specific preferences such as Git, Groovy, etc. 

This article will show Proxy, Test Case, and Mobile Preferences in Katalon.

Proxy Preferences

Let us understand what proxy servers are first.

What are proxy servers?

Proxy servers are intermediary servers. They act as middlemen between a client and a server. When a client needs to make a request to a server or the Internet, it does not send the request directly. Instead, it sends the request to a proxy server. The proxy server is responsible for forwarding the request to the correct server and sending the response back to the client.

This diagram shows how communication using proxy servers occurs:

Communication using a Proxy Server

Here, Bob uses Alice as a proxy while accessing Ninja.

A proxy server has many advantages. Some are:

  • They increase security. We don't have to add security measures to all clients. Instead, we can ensure that the proxy server that everyone is using has state-of-the-art security. Thus, if a server on the internet tries to send malicious data, the proxy server will catch it. 
     
  • They provide structure to the architecture. Sometimes, networks can get very complicated and hard to understand. It becomes tough to analyze which requests came from which client. Proxies help provide structure.
     
  • They provide load balancing. If the Ninja server in the example receives millions of requests per second, it might not be able to handle them. Each request might be complicated too. 
    However, we can duplicate the Ninja server 5 times. A proxy can be used to decide which client gets which copy of the Ninja server. The proxy has only to forward the request, not compute it. Hence it will be able to handle a large number of requests.
     
  • They increase privacy by hiding the identity of the client.
     

Now, let's look at setting up Proxy servers in Katalon. 

Proxy Server in Katalon

Since version 7.5.0 of Katalon, proxies have been divided into two types.

  • Authentication Proxies are used when connecting to and authenticating to Katalon servers. These are used for logging in to your account, Katalon TestOps, TestCloud, auto-updater, etc.
     
  • System Proxies are used for any network connection that Katalon makes. Testing, spying, and recording are included in this. 
     

To view, go to Preferences by pressing Ctrl+Shift+P on Windows or Command + , on Mac.

Proxy Preferences in Katalon

Go to Katalon->Proxy->System. 

Both system and authentication proxies have the same settings that we can set based on our needs. 

Proxy Preferences Settings

 

Proxy Option

This specifies which type of Proxy is applied. There are 3 options we can choose from for Proxy Option. 

Proxy Option- type of proxy applied
  1. No proxy is used when we don't require a proxy connection.
     
  2. System Proxy Configuration is used when our system already uses a proxy. Katalon will figure out the proxy server you are using based on OS and browser settings.
     
  3. Manual Proxy Configuration is used when we want to set up our proxy manually.
     

The other options are only enabled when Proxy Option is set as Manual.

Proxy Server Type

This specifies the type of protocol our proxy server uses.

Proxy Server Type

This can be HTTP, HTTPS, or SOCKS. SOCKS is a special protocol designed explicitly for Proxy Servers.

Address and Port

This represents the IP address of the proxy server, such as 192.168.10.1. The port is the port that the proxy server listens to for requests, such as 3000.

Excludes

The addresses written in this field are excluded from the proxy. Their connections are made directly. Proxy exceptions are only supported in web recorders and spy utilities with Firefox and Chrome.

Authentication

Some proxy servers need the user to authenticate. For this, we can add a username and password. This is only supported with SOCKS proxy servers.

Auto Apply to Desired Capabilities

Desired Capabilities in Katalon are the desired features we wish our current project's tests to have. By default, Katalon applies system proxies to desired capabilities too. We can disable this if we want. 

To apply a different proxy to a project, go to Project->Settings->Desired Capabilities.

Project Settings Menu

Go to desired capabilities. Select the testing environment you want to apply the proxy to.

Project Settings Dialog Box with testing environment selected

Click on Add. Set the name as proxy, and type as Dictionary. 

Add new field named Proxy of type Dictionary

The proxy details should be specified according to this format:

Key

Description

proxyType

(Required) The type of proxy being used. 

Possible values are: 

direct - Directly connect, i.e., no proxy in use.

manual - Manual proxy settings. 

pac - Proxy autoconfiguration from a URL.

autodetect - Auto-detect Proxy.

system - Use system settings.

proxyAutoconfigUrl (Required if proxyType is pac) Tells the URL to be used for auto-configuring proxy. 
ftpProxy, httpProxy, sslProxy, socksProxy (Optional) Specifies the proxies to be used for FTP, HTTP, HTTPS, and SOCKS requests respectively. 
socksUsername (Optional) SOCKS proxy username.
socksPassword (Optional) SOCKS proxy password.
noProxy (Optional) Specifies the addresses which will be accessed without a proxy.

An example could be : {proxyType=manual,httpProxy=127.0.0.1:12700}

Fill in values for fields in Dictionary Property Builder
Our proxy is now applied.

Test Case Preferences

Test case preferences are what configure how our test cases are run. 

You can view them by going to the Preferences menu->Katalon->Test Case.

Test Case Preferences

Test Case Calling

This configures how Katalon should behave, when we call one test case, as a part of another. For e.g, to test if a user can buy a product, we need to test if the login test works first.

For our example, let's say there is a Login Test Case, with two variables - username and password.

Setting variables in test cases.

Their default values are set as above. 

Now, let's look at the two available options.

  • Generate variable with default value. In this, whenever the value of username is required, the value ninja_user will be used. Similarly, for password, the value NinjaSecurePassword will be used. Thus, the values are the default values.
     
  • Generate variable with the same name as the exposed variable of the called test case. In this, whenever the value of username is required, the value username itself will be used. Similarly, for password, the value password will be used. Here, the values are the same as the variable name.

    There is also a sub-option here Expose variables automatically after choosing the called test case. If this is ticked, the variables of the called test case are added to the variables tab of the calling test case. 

    Eg - for testing buying a product the variables might be - productId, Quantity, Price. But since we are calling the login test case too, the variables username and password will also be added to the variables of the test to buy a product.

Default Open View

By default, Katalon will open your test in the manual view. We can set it to be opened in the script view instead.

Manual View

Manual View

Script View

Script View

Default Keyword Type

We frequently add items to our test cases in Katalon. Based on which type of testing we do frequently, we can set the default keyword type from the options given.

Default Keyword Type

We can also choose a default Keyword Name. Then, whenever we click on Add In Katalon test cases, our chosen keyword type and name will be added. 

Line Wrap

While writing test cases and scripts, the line can often go beyond the length of the screen. We can set line wrap to move the overflowing text to the next line.

Line Wrapping set to 150:

Line Wrapping as 150

Line Wrapping set to 80:

Line Wrapping set to 80

Mobile Preferences

Katalon has support for Appium, which is a mobile testing automation tool. It allows us to write automated tests for Android and iOS apps, as well as Web Apps and Hybrid Apps. We can configure Appium with Katalon by specifying the directory in which our Appium software is.

Mobile Preferences in Katalon

Frequently Asked Questions

Line wrapping isn't working for me, what should I do?

If lines aren't wrapping even beyond the character length, you might have to restart Katalon. If that doesn't work, just type Ctrl+Shift+F on Windows, and Command+Shift+F on Mac. This should wrap your lines!

Are there free proxy servers available too?

Yes, there are multiple online proxies that provide their services for free. But, they do show advertisements for this. Some may even keep track of your data - so be careful!

What happens if I set proxyType as manual, and connect via FTP without providing an ftpProxy value?

Selenium WebDriver (which is what Katalon uses) says the behaviour for this is undefined. You should avoid doing this.

Conclusion

This blog has explored what proxy and test case preferences are in Katalon. We have also seen the functions and meanings of proxy servers in detail.

We hope you leave this article with a broader knowledge of Katalon, preferences, and testing. We recommend that you explore our different articles on these topics as well, such as Sample API Test Projects in Katalon

You can practice questions on various problems on Coding Ninjas Studio, attempt mock tests. You can also go through interview experiences, interview bundle, go along guided paths for preparations, and a lot more!

Keep coding, and keep reading Ninjas. 

Live masterclass