Manual mode on a test case refactors its underlying code

Please let us know what you are using Katalon Studio for?

I have currently applied Katalon Studio in my project

How would your work be affected if this issue has not been resolved?

I can continue my job, but my performance is lower than expected

Operating System

Windows 10

Katalon Studio Version

8.1

Steps to reproduce:

This happen whenever I begin work on some new test case, that is copied and pasted from another one. For example, when I am creating negative test case from another one, and switching up the test objects used within.

Here’s some code, at the top of it, in the format I want to keep it in:

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

import java.util.concurrent.TimeUnit

import com.github.javafaker.DateAndTime
import com.github.javafaker.Faker
import com.kms.katalon.core.annotation.SetUp
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.signaturemd.constants.Formats
import com.signaturemd.constants.SMDConstants
import com.signaturemd.models.contract.ContractModel
import com.signaturemd.models.contract.details.BankDetailModel

Faker faker = new Faker()
DateAndTime dateAndTime = faker.date()
Date startDate = dateAndTime.past(SMDConstants.DAYS_IN_A_MONTH, TimeUnit.DAYS, new Date()),
	signDate = dateAndTime.past(SMDConstants.DAYS_IN_A_MONTH, TimeUnit.DAYS, startDate)

String alphabeticCardFeeStr = "er"

ContractModel model = new ContractModel(signDate, 
    startDate, 
    3, 
    "dummy label", 
    15, 
    15, 
    26, 
    SMDConstants.URL, 
    new BankDetailModel())

What happens afterward, to my code itself and the imports, is a mess.

Expected Behavior:

It to keep my formatting (see above), as well as the following imports as they were:

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

import java.util.concurrent.TimeUnit

import com.github.javafaker.DateAndTime
import com.github.javafaker.Faker
import com.kms.katalon.core.annotation.SetUp
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.signaturemd.constants.Formats
import com.signaturemd.constants.SMDConstants
import com.signaturemd.models.contract.ContractModel
import com.signaturemd.models.contract.details.BankDetailModel

Actual Behavior:

Whatever you want to call this mess:

import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import java.util.concurrent.TimeUnit as TimeUnit
import com.github.javafaker.DateAndTime as DateAndTime
import com.github.javafaker.Faker as Faker
import com.kms.katalon.core.annotation.SetUp as SetUp
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.signaturemd.constants.Formats as Formats
import com.signaturemd.constants.SMDConstants as SMDConstants
import com.signaturemd.models.contract.ContractModel as ContractModel
import com.signaturemd.models.contract.details.BankDetailModel as BankDetailModel

Faker faker = new Faker()

DateAndTime dateAndTime = faker.date()

Date startDate = dateAndTime.past(SMDConstants.DAYS_IN_A_MONTH, TimeUnit.DAYS, new Date())

Date signDate = dateAndTime.past(SMDConstants.DAYS_IN_A_MONTH, TimeUnit.DAYS, startDate)

String alphabeticCardFeeStr = 'er'

ContractModel model = new ContractModel(signDate, startDate, 3, 'dummy label', 15, 15, 26, SMDConstants.URL, new BankDetailModel())

How do we stop this from happening, outside of just don’t use Manual Mode when you have your own code involved?

No way.

Don’t switch from “Script mode” to “Manual mode” at all.