Varying the object properties

Hi,
I’m new to Automation Testing tools, I have few queries,

  1. Can we change the Object properties?

We have a object and its properties are as below

x = 500, y = 408, width = 608 and Height = 80.

Want to write a script that changes X value in the multiples of 5.

  1. Do we have any Builtin Mobile Keyword that can help me with drag and drop at a point ( Like a Slider).???

Consider a slider Similar to increase Volume up/down.

Hi Mandy,

  1. You can definitely change Test Object properties programmatically:

Add these imports to the top of your test file:

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

In your test:

int x = 500
TestObject myObject = new TestObject("My Object")
// Loop this bit:
myObject = myObject.addProperty("x", ConditionType.EQUALS, x * 5)
  1. You can check out the setSliderValue() function:

https://api-docs.katalon.com/studio/v5.0/api/com/kms/katalon/core/mobile/keyword/MobileBuiltInKeywords.html#setSliderValue(TestObject,%20java.lang.Number,%20int,%20com.kms.katalon.core.model.FailureHandling)

Hope this helps,

Chris

1 Like

Hi Chris,

These are the Test Object properties,

And this the Slider i’m trying to control, Its ‘x’ value is ‘619’ when the Slider position at ‘0’ and at maximum position the value of ‘x’ is ‘1433’.

And want to loop so that x value changes to x+200;
Is there any way to do so, Because i tried to use setSliderValue, but not worked.

image.png

Capture.PNG