// modify WebUI.* keywords which take TestObject as arg0
// so that they call Highlight.on() automatically
CustomKeywords.‘com.kazurayam.ksbackyard.HighlightElement.pandemic’()
WebUI.click(findTestObject(‘Object Repository/Submit Susan Loop/a_Login’))
WebUI.delay(1)
WebUI.setText(findTestObject(‘Object Repository/Submit Susan Loop/input_E-Mail Address_email’), ‘jecsanmaychel01@gmail.com’)
WebUI.delay(1)
WebUI.setEncryptedText(findTestObject(‘Object Repository/Submit Susan Loop/input_Password_password’), ‘bI3RgGn7xr4YpfW5IuOWug==’)
WebUI.delay(1)
WebUI.click(findTestObject(‘Object Repository/Submit Susan Loop/button_Login’))
WebUI.delay(1)
CustomKeywords.‘Loop.getloop’()
WebUI.click(findTestObject(‘Object Repository/Submit Susan Loop/a_Logout’))
WebUI.delay(1)
I want in the script loop when the field points are filled with even/odd numbers, it automatically fills in the name, odd for; Susan and even for: Jaka
int points = 0;
if(i % 3 == 0) {
points = i * 3;
} else if (i % 4 = 0) {
points = i * 4;
} else if (i % 5 = 0) {
points = i * 5;
} else {
points = i;
}
You essentially check for multiples by using the mod (%) operator. If you want to check if a number is a multiple of x, you mod it with x and check that the remainder is zero:
I’m probably misunderstanding how this will be used to accomplish what you want to do in Katalon (I think we have a pretty serious language barrier), but I do believe that I’ve at least given you the tools you need to figure this out.
this issue was recruitment test for my company, and TS not read this question carefully, even though I already show the output example…
for info: TS failed the test