[WebUI] Modify Object Property


This is a companion discussion topic for the original entry at https://docs.katalon.com/katalon-studio/docs/webui-modify-object-property.html

hello, I am try to do this for a Test Object that is of type Image, is this possible?
Can you please provide a sample?
I have too many images files and don’t want to manage and create an object for every image. Consuming too much time.
Thanks

I have tried a few things but it is not working.
For example in object repository, I have a dummy image object (dummyImg), with the Image path point to file of gif file.
Then in the script:
newImg = new TestObject(‘dummyImg’)
newImg.setImagePath(“login.gif”) //set TestObject to new image. This file reside in Katalon project folder.
WebUI.clickImage(findTestObject(newImg)) //Try to click on new image. This is not working.

Will this work for Mobile?

Hi,

Once a run time test object, called v_to, is created using Modify Object Property then what is its life cycle for that test case?
Can I use the new test object created later in the same test case?
If v_to is created in Home page of my application and then I navigated away from home page, would v_to exist upon my re-visit to home page?

Yes it should still be visible if you navigate away and return. The object will remain accessible within that test case. When you use modifyObjectProperty, you are essentially making a new object (im sure you knew that but wanted to include it as well)

Thank you for your response.

I’m having a problem with that method, i can use click on object created lika that, but set test and send keys aren’t working, anyone know why?

Do you get an error you when try that?

I have a slider with property name data-value, and I want to change its value, click to save button, and check its value. What should I do?

Blockquote
for(int i = -5; i <= 5; i++){
TestObject newValue = new TestObject()
newValue = WebUI.modifyObjectProperty(findTestObject(Web/Change_Slider)), ‘data-value’, null, i, false)

WebUI.delay(2)
'Click to Save value'
WebUI.click(findTestObject('Web/Save_button'))

'Delay to view the browser work'
WebUI.delay(30)

}