Test Objects get recorded without Basic and CSS selectorCollection entries

An object captured through Web Spy gets persisted to disk with the following:

When calling this object with:

import com.kms.katalon.core.testobject.SelectorMethod

@Keyword
def getTestObjectXpath(TestObject obj)
{
	return obj.getSelectorCollection().get(SelectorMethod.(obj.getSelectorMethod()))		
}

null is returned, which makes sense because there is no entry for BASIC. As a workaround I’ve found simply opening the test object, making any change, and saving will save the remaining info:

Hi @dhopson

Can you show us what was the element being recorded, what browser did you use and the version of Katalon Studio ?

Cheers !

I checked this again since v7 came out, it looks like the issue is still present.

  • Chrome Version 78.0.3904.70 (Official Build) (64-bit)
  • Katalon Studio 7.0.3

I captured the “Make Appointment” button from the http://demoaut.katalon.com/ demo site in Object Spy, saved without making any changes, and then ran this script:


import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.testobject.SelectorMethod as SelectorMethod
import com.kms.katalon.core.testobject.TestObject as TestObject

def getTestObjectXpath(TestObject obj) {
    return obj.getSelectorCollection().get(SelectorMethod.(obj.getSelectorMethod()))
}

println getTestObjectXpath(findTestObject('Page_CURA Healthcare Service/a_Make Appointment'))

running it returns null and looking at a_Make Appointment.rs in a text editor shows there is an entry for selectorMethod in the XML, but the selectorCollection node is missing.

Workaround:
I browsed the the object in Object Repository and changed the Selection Method radio to Xpath and back to Attributes (just enough interaction to enable the save button) and then saved changes. If you have the rs file open in something like notepad++ you’ll see that its been changed on disk and reloading the file shows it now contains the missing selectorCollection node with entries for BASIC and XPATH


a_Make Appointment.zip (1.7 KB)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.