jTables td element not clickable even if using the xpath with //td[@id='userRow1778_25'] ID

I am testing a jTable Tabel. It is a teamcalendar (in the context of sharepoint) but developed from scratch as a webpart.

Test case. When you click onto a cell in the table with no entries the dialog to add an event is displayed. I spyed the objects into the repository and the td of the tabl have their unique ID which was perperly spyed. After running the test case the first time I could add an event which was added to the persons row. To add a second event I war running the test case a second time. But instead of clicking the td it was clicking the event which is embedded into the td as a div. Instead of beeing in the NewDialog the event has been clicked and opened the update dialog and my testcase failed.

I tested the correctness of my xpath string by using chromes developer tools and injected a call by using the console => document.querySelector(td[id=‘userRow1778_25’]);

This worked as it should so the locator is correct.

I wrote a custom keyword which solved the problem.
@Keyword
def ClickByJavascript(String repositoryObject) {
TestObject clickOjb = findTestObject(repositoryObject)
List xPaths = clickOjb.getXpaths()
String strxpath = xPaths.get(0).value
strxpath = strxpath.replace(“//”, “”)
strxpath = strxpath.replace(“@”, “”)
String cmd = “document.querySelector("” + strxpath +“").click()”
WebUI.executeJavaScript(cmd, null)
}

But unfortunately as workarround. What’s wrong here?`
The object in the repository looks like this and it should be fine:

Did anyone use jTable in any test case up to now since I could not find a single hint for anyone using it?

You are driving in the slow lane, with all the trucks and people towing camper vans.

You have proved you know what you’re doing in the DOM. You can successfully detect an element ID yourself using the browser tools AND you can test your theories by issuing commands in the console. Now you need to take the next step(s) - join the fast lane - switch to Script View and code the steps yourself.

If you code a WebUI.click() using that CSS selector or XPath, it will work. And if not, use JavaScript instead.

The Spy tool is like training-wheels on a bicycle. Time they came off, I think.

Thank you Russ_Thomas for your reply.
I used WebUI.click(findTestObject(‘Object Repository/Teamkalender/td_Aufgabe_userRow1778_25’)) in the script and it did not do the job.

CSS selector does not work since the table is dynamic table in number of rows and colums. Therefor we created a unique ID for all of the cells.

This is my workarround:

@Keyword
	def ClickByJavascript(String repositoryObject) {
		TestObject clickOjb = findTestObject(repositoryObject)
		List<TestObject> xPaths = clickOjb.getXpaths()
		String strxpath = xPaths.get(0).value
		strxpath = strxpath.replace("//", "")
		strxpath = strxpath.replace("@", "")
		String cmd = "document.querySelector(\"" + strxpath +"\").click()"
		WebUI.executeJavaScript(cmd, null)
	}

As matter of fact all my colleagues are using Katalon since months could not find anything wrong from my side. I really does not work.

Let’s just see if this works:

String cmd = “document.querySelector('#userRow1778_25').click();"
WebUI.executeJavaScript(cmd, null)

:smiley:
This is exactly what I used as workarround. So you confirm that Katalon has an issue with jTabel?
Anyway I think we are done

Thank you so far and enjoy the rest of the day :slight_smile:

No, I don’t confirm that. Your issue lies somewhere else, but with so little to work with, I can’t say where.