Debugging => Expressions tab issues

Hey all,

Banging my head against the Expressions tab when debugging.

I sometimes feel like I need to give up with Katalon debugging, it definitely isn’t mature enough although they proudly mention the fact that it’s based on Eclipse.

I know there’s a limitation (aka - a major bug) there, you cannot just use the expression the same way you use them in the regular script editor. For instance, you cannot just call WeUI cause it’s an alias supplied by Katalon automatically - whenever you use it, Katalon adds the following line to the import section:

import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI

- meaning - if you’d like to use it in the expression tab you MUST use the fully qualified name (in this case - com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords). Ok, this I can live with - a bit annoying considering the size of the expression cell. There’s also the thing with quotes vs double-quotes there. You need to figure out where double-quotes should be used and where single-quotes work.
But even if I do use the fully qualified name, I cannot figure out what the fully qualified name for “CustomKeywords”. This one doesn’t appear in the import section and I can’t find its FQN.
Here’s what I’m trying to do:
I’m using the following method to get a TestObject of a table cell (a td tag under a tr tag):

@Keyword//For classical tables

public TestObject getTdTestObject(TestObject baseTestObject,int rowIndex,int colIndex){

TestObject updatedTestObject = getTestObject(baseTestObject,“/tr[” + rowIndex+ “]/td[” + colIndex + “]”)

return updatedTestObject


The TestObjet this method receives is the table from which it’ll select the needed object.

The way I use it in my script is:‘com.helper.grid.GridHelper.getTdTestObject’(findTestObject(‘My Repository/…/gmail/Bin table’), 1, 2), FailureHandling.STOP_ON_FAILURE)

But as I said, this expression cannot be used in the expression tab.

Can anyone help? A working example (one-liner) would be much appreciated.


Banging my head against the Expressions tab when debugging.

I hear you – the debugger is pretty weak in this area.

Have you tried breaking the problem down?

def getTDFn = CustomKeywords.'com.helper.grid.GridHelper.getTdTestObject'

Note I’ve never tried the above – it should be possible to store a reference to a function but equally I wouldn’t be surprised if Keywords don’t play fair. In which case…

I’d make the keyword a regular static method and call it directly (note: you don’t need the @Keyword decorator):

static TestObject getTdTestObject(TestObject baseTestObject,int rowIndex,int colIndex){
  TestObject updTo = getTestObject(baseTestObject,"/tr[" + rowIndex+  "]/td[" +   colIndex + "]")
  return updTo

Then in your test case…

Don’t forget to import your class statically.

Good luck!