Targeting a specific web server for testing

Hello, everyone,
Presently my company has eight web servers in its Production environment.
If I want to verify that deployment, right now it’s a manual effort to set a specific server IP in local HOST file, and then perform the validation.

Is there a way to automate this in Katalon? Ideally I’d like to have a test case that could target a specific server, based on IP address.

Hope this call for help is clear. Thank you for your time.

Have a look at “Execution Profile”
https://docs.katalon.com/pages/viewpage.action?pageId=13697476

Do you want an example? Then have a look at this:

This demo shows you how to:

  1. You create a GlobalVariable named hostname in the default Execution Profile. You set a valid DNS host name or a IP address to the GlobalVariable.hostname of the default profile.
  2. You can create multiple profiles. If you have 8 web servers to test, then you want to create 8 profiles. One profile for each machine. You want to create GlobalVariable named hostname in each profiles. You want to set valid DNS host name or IP addresses. create profile with host name
  3. You create a test case which opens browser and let it nagivate to the URL refering to the GlobalVarialbe.hostname. See the test case source at https://github.com/kazurayam/KatalonDiscussion7518/blob/master/Scripts/TC1/Script1529627764306.groovy
  4. When you run the test case, you have a option to choose a Profile to apply to the test case execution. In other words, you can switch the hostname with the value specified in the Profile you chosen. In the top right corner of Katalon Studio UI you find a button to choose Profile. choose profile to apply

Jed,

Create a Test Case that relies on an Excel worksheet for its data…

Enter the IP Address for your URL (xxx.xxx.xxx.xxx), into the first column of your Excel Worksheet…

Enter 8 rows for each of your eight Production servers…

This may result in Certificate errors that will need to be resolved, depending on how your network is set up…

e.g.

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint

import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase

import static com.kms.katalon.core.testdata.TestDataFactory.findTestData

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject

import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint

import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords

import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile

import com.kms.katalon.core.model.FailureHandling as FailureHandling

import com.kms.katalon.core.testcase.TestCase as TestCase

import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory

import com.kms.katalon.core.testdata.TestData as TestData

import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory

import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository

import com.kms.katalon.core.testobject.TestObject as TestObject

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords

import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords

import com.thoughtworks.selenium.webdriven.commands.RunScript as RunScript

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

import internal.GlobalVariable as GlobalVariable

import net.sourceforge.htmlunit.corejs.javascript.ast.ForLoop as ForLoop

import org.openqa.selenium.Keys as Keys

for (def row = 1; row <= findTestData(‘Kuali Login’).getRowNumbers(); row++) {

WebUI.openBrowser('')



WebUI.maximizeWindow()



WebUI.navigateToUrl(findTestData('Kuali Login').getValue(1, row))



WebUI.setText(findTestObject('Page_Kuali Login/Username'), findTestData('Kuali Login').getValue(2, row))



WebUI.setEncryptedText(findTestObject('Page_Kuali Login/Password'), findTestData('Kuali Login').getValue(3, row))



WebUI.click(findTestObject('Page_Kuali Login/Sign In'))



WebUI.delay(2)



WebUI.navigateToUrl(findTestData('Kuali Login').getValue(4, row))



WebUI.delay(2)



WebUI.callTestCase(findTestCase('Development Proposal Lookup'), \[:\], FailureHandling.STOP\_ON\_FAILURE)



WebUI.closeBrowser()

}