Is it possible to work without Object Repository?

Hi. Im trying Katalon Studio and I think it is a great tool for automatic testing.

But we have a problem with our workflow. Is it possible to work without Object Repository in manual mode? For us it is to much work to create for each website for each elements (which we want to test) the objects becaue we have many websites with many elements to test.

In Katalon Automation Recorder for example we can type the element selector (css path) directly in the test (target field).

Why we can’t do that in Katlon Studio in manual mode? For us it is to complex to create so many objects. In addition the object list will be very confused. It would be great if I can type (for example) css=span.example in the object field.

Thanks for any tips.

Pete

Hello Pete,
I too also feel that too many objects was too much to manage.
If you are comfortable writing test case in Script mode (I recommend script mode over Manual mode; also don’t switch between the two. I had random issues where switch between Manual and Script mode would alter my test script syntax), you might be able to limit the number of objects, by parameterize your object. Try searching forum on this there are some threads on this.
I was able to limit objects by using mainly xpath and parameterizing it.

Also you can alter an object at runtime with .addProperty or .setProperties

Regards

paramSamp1.jpg

Hi. Yes I try to work with script mode but I don’t have the possibility to select an element without Katalon objects. When I use WebUI.setText… I have to type a testobject. But I won’t use the objects because it is too much work to create objects for each element for each website which I need.

For example I want to select objects directly in the script (without objects) like:

WebUI.setText(‘css=input#search_frm.form-control.toggle_tooltip’, ‘Test’)

This is the big advantage in the Katalon Automation Recorder. Here I can type the selector of the elements manually, I don’t need any created objects.

How I can do that in Katalon Studio?

I don’t understand why I have to crate for each element (I want to test) for each website an object.

We would like to use Katalon Studio but this behavior is a big blocker to use Katalon

Pete

@Pete Meir said:
Hi. Yes I try to work with script mode but I don’t have the possibility to select an element without Katalon objects. When I use WebUI.setText… I have to type a testobject. But I won’t use the objects because it is too much work to create objects for each element for each website which I need.

For example I want to select objects directly in the script (without objects) like:

WebUI.setText(‘css=input#search_frm.form-control.toggle_tooltip’, ‘Test’)

This is the big advantage in the Katalon Automation Recorder. Here I can type the selector of the elements manually, I don’t need any created objects.

How I can do that in Katalon Studio?

I don’t understand why I have to crate for each element (I want to test) for each website an object.

We would like to use Katalon Studio but this behavior is a big blocker to use Katalon

Pete

Hi Peter,

At first you can see KR provide a faster way to create your test. However in the long run it will be a big troubles and large efforts to maintain your used ‘locators’ directly, you have to search for it, and then replace it v.v…Well maintenance efforts will be big for later use. That’s why Katalon Studio manages objects using a term called Test Object differently than Katalon Recorder. You can checkout differences between Katalon Studio and Katalon Recorder here:
https://www.katalon.com/resources-center/blog/katalon-automation-recorder/

Hi. I’m sorry but for our workflow it doesn’t apply. During my tests I often notice that I forgot some elements for my testcase. So (my currently understanding) is:

1. Abort the test editor
2. Open the Syp Web or Record Web
3. Open the site again (I have to type login information for each new record because we have no website, we have an ASP solution)
4. Select the elements
5. Save elements as object
6. Open the test editor again and add the object

So for me this is not convinient to create testcases and will take more time as type the selector directly in the editor.

Pete

Once you create a full repository it’s super easy to build tests. It really is the best way, first setting it up can be time consuming but it’s worth it. If you do it while writing the test you are doing the same thing but your objects cannot be used outside of that test.

I would recommend using folder breakdown and alot of renaming to manage objects in the repository. For example have a folder named after the page, then another folder for type of objects

Example
google search page (folder)
field (folder)
good search bar (object)

I also use a naming convention with numbers to make them easier to find for example I number then based upon where they are on the page:
01_label_PageLabel
02_field_SearchField

For example

If you really want to do it in test, I would use the modify object with a single object repository:
Here is the link:
https://docs.katalon.com/display/KD/[WebUI]+Modify+Object+Property

new_btn = WebUI.modifyObjectProperty(findTestObject(``'Page_Login/btn_Login'``), ``'xpath'``, ``'equals'``, ``'//*[@type=\"button\"]'``, false)
You would start your test with a list of objects and modify the same object from repository to have the stats you need.

The new_btn above is the object name you would use this to refer to the object for your clicks and text input etc

WebUI.click(new_btn)

for example.

- the modify starts with location in repo,
- then the type of data (above it’s xpath),
- then condition (must match repo conditions)
- then value
- last is “detect object” this is that checkbox for if this help you find the object. Normally you want this “true” that means checked. False means it’s not checked.

Hope this helps, good luck

HI, B L
I try to do as this link https://docs.katalon.com/display/KD/%5BWebUI%5D+Modify+Object+Property but i found error as log below

‘Modify xpath of \‘Login\’ button’

new_btn = WebUI.modifyObjectProperty(findTestObject(‘page_Login/btn_Login’), ‘xpath’, ‘equals’, ‘//*[@class = \“mat-raised-button mat-prary\”]’, false)

‘Click on new_btn’

WebUI.click(new_btn)

First, I change xpath to “//*[@class = “mat-raised-button mat-prary”]”

[START] - Start action : Statement - new_btn = com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.modifyObjectProperty(com.kms.katalon.core.testobject.ObjectRepository.findTestObject(page_Login/btn_Login), “xpath”, “equals”, “//*[@class = “mat-raised-button mat-prary”]”, false)

[INFO] - Finding Test Object with id ‘Object Repository/page_Login/btn_Login’

[INFO] - Check Test Object

[INFO] - Check property name

[INFO] - Check modify value

[INFO] - Check match condition

[PASSED] - Modify property of object successfully

[END] - End action : Statement - new_btn = com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.modifyObjectProperty(com.kms.katalon.core.testobject.ObjectRepository.findTestObject(page_Login/btn_Login), “xpath”, “equals”, “//*[@class = “mat-raised-button mat-prary”]”, false)

Next, I click on new_btn

[START] - Start action : click

[INFO] - Checking object

[INFO] - Checking timeout

[INFO] - Finding web element with id: ‘Object Repository/page_Login/btn_Login’ located by ‘By.xpath: //*[@class = ‘mat-raised-button mat’]’ in ‘30’ second(s)

[FAILED] - Unable to click on object ‘Object Repository/page_Login/btn_Login’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/page_Login/btn_Login’ located by ‘By.xpath: //*[@class = ‘mat-raised-button mat’]’ not found)

[FAILED] - Test Cases/Test_WRP FAILED because (of) Unable to click on object ‘Object Repository/page_Login/btn_Login’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/page_Login/btn_Login’ located by ‘By.xpath: //*[@class = ‘mat-raised-button mat’]’ not found)

[END] - End action : click

so i didn’t know why xpath will not changed.

Please recommend me what is wrong on this code.
Thanks

I believe false is throwing you off, if you have false it does not use the property to find the object. change this to true.

So you have this:

‘Modify xpath of \‘Login\’ button’

new_btn = WebUI.modifyObjectProperty(findTestObject(‘page_Login/btn_Login’), ‘xpath’, ‘equals’, ‘//*[@class = \“mat-raised-button mat-prary\”]’, false)

instead try this:

‘Modify xpath of \‘Login\’ button’

new_btn = WebUI.modifyObjectProperty(findTestObject(‘page_Login/btn_Login’), ‘xpath’, ‘equals’, ‘//*[@class = \“mat-raised-button mat-prary\”]’, true)

That should work for you, I would be interested in hearing the results.

@B L said:
I believe false is throwing you off, if you have false it does not use the property to find the object. change this to true.

So you have this:
‘Modify xpath of 'Login' button’

new_btn = WebUI.modifyObjectProperty(findTestObject(‘page_Login/btn_Login’), ‘xpath’, ‘equals’, ‘//*[@class = "mat-raised-button mat-prary"]’, false)

instead try this:
‘Modify xpath of 'Login' button’

new_btn = WebUI.modifyObjectProperty(findTestObject(‘page_Login/btn_Login’), ‘xpath’, ‘equals’, ‘//*[@class = "mat-raised-button mat-prary"]’, true)

That should work for you, I would be interested in hearing the results.

Hi, B L

Thanks for your recommended
but i found the same problem. I don’t understand why property will not change.

[START] - Start action : Statement - new_btn = com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.modifyObjectProperty(com.kms.katalon.core.testobject.ObjectRepository.findTestObject(page_Login/btn_Login), “xpath”, “equals”, “//*[@class = “mat-raised-button mat-prary”]”, true)
[INFO] - Finding Test Object with id ‘Object Repository/page_Login/btn_Login’
[INFO] - Check Test Object
[INFO] - Check property name
[INFO] - Check modify value
[INFO] - Check match condition
[PASSED] - Modify property of object successfully
[END] - End action : Statement - new_btn = com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.modifyObjectProperty(com.kms.katalon.core.testobject.ObjectRepository.findTestObject(page_Login/btn_Login), “xpath”, “equals”, "//[@class = “mat-raised-button mat-prary”]", true)
[START] - Start action : click
[INFO] - Checking object
[INFO] - Checking timeout
[INFO] - Finding web element with id: ‘Object Repository/page_Login/btn_Login’ located by 'By.xpath: //
[@class = ‘mat-raised-button mat’]’ in ‘30’ second(s)
[FAILED] - Unable to click on object ‘Object Repository/page_Login/btn_Login’ (Root cause: com.kms.katalon.core.webui.exception.WebElementNotFoundException: Web element with id: ‘Object Repository/page_Login/btn_Login’ located by ‘By.xpath: //*[@class = ‘mat-raised-button mat’]’ not found)

@Pete Meir
If you want to override the Object Repository, check this post out:
http://forum.katalon.com/discussion/comment/13536/#Comment_13536

hmmm do you only have an xpath on the base object? Can you see the object when you inspect the page and use that xpath?