Sometimes when running a test, I don't see execution of some steps and find it passed in the log viewer

Hello All,

For a test, when I run it, I can’t see the execution of some steps, although I see them passed in the log viewer (as shown below, it failed at step 12, but I did not see step 10 myself, and it is marked passed in the log viewer. in the app, I should click 3 dots element first then click edit button) & this happens sometimes

And I get the error of “ElementNotInteractableException: element not interactable”
Some times

So is it a common issue (that some steps of execution I can’t see although they passed in the log)? and what should I do to avoid this?

Thanks,

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

1 Like

There are multiple reports that you can review about your test run, and the “Log Viewer” and “Console” tabs as well, that can give you more information about “what happened”.

Personally, how about moving your line 8, WebUI.maximizeWindow(), to number 2 and then add a WebUI.waitForPageLoad(10) after it. Maybe have something like below:

image

1 Like

I added these steps as you said, but got same problem, the issue is that while executing the test, I do not see running the step marked in the screen shot, but in the log this step is marked passed & error appears for the following step,

Can u pls login & try it in that link: Community App - Admin Panel

Login : y@yopmail.com/Password@1
I try to edit the 2nd item in the list, by clicking 3 dots element then clicking edit button

Thanks for u help :slight_smile:

Here is my attempt at your issue. The application does not like to please Testers, so ugg. Hope the below assists you, but you probably already were able to do finish your issue.

Maybe like:
/**
 * Helper function that creates a new TestObject with xpath
 *
 * @param pathway to the element
 * @return this test object led to by the pathway
 */
def TestObject newTestObject(String xpath) {
	TestObject to = new TestObject(xpath)
	to.addProperty('xpath', ConditionType.EQUALS, xpath)
	return to
}

def gSiteURL = "https://mm-commapp-admin-test-d820cf01c966.herokuapp.com/auth/login?returnUrl=%2Fsupport%2Fsupport";
def gUsername = "y@yopmail.com"
def gPassword = "Password@1"

WebUI.openBrowser('')
WebUI.maximizeWindow()
WebUI.navigateToUrl(gSiteURL)
WebUI.waitForPageLoad(10)

"username"
TestObject input_signin_UserName = newTestObject('id("email")')
WebUI.waitForElementVisible(input_signin_UserName, 10)
WebUI.verifyElementVisible(input_signin_UserName)
WebUI.setText(input_signin_UserName, gUsername)
WebUI.verifyElementAttributeValue(input_signin_UserName, "value", gUsername, 10)

"password"
TestObject input_signin_Password = newTestObject('id("password-input")')
WebUI.verifyElementVisible(input_signin_Password)
WebUI.setText(input_signin_Password, gPassword)

"sign in"
TestObject button_Signin = newTestObject('//button[normalize-space()="Sign In"]')
WebUI.verifyElementVisible(button_Signin)
WebUI.click(button_Signin)
WebUI.waitForPageLoad(10)

"news and events"
TestObject span_News_Event = newTestObject('//span[text()="News & Events"]')
WebUI.waitForElementVisible(span_News_Event, 10)
WebUI.verifyElementVisible(span_News_Event)
WebUI.click(span_News_Event)

"news"
TestObject a_News = newTestObject('//a[normalize-space()="News"]')
WebUI.waitForElementVisible(a_News, 10)
WebUI.verifyElementVisible(a_News)
WebUI.click(a_News)
WebUI.waitForPageLoad(10)

"click on the dots of the third row"
TestObject three_dots = newTestObject("//table/tbody/tr[3]/td[last()]/div/div/button")
WebUI.waitForElementVisible(three_dots, 10)
WebUI.verifyElementVisible(three_dots)
WebUI.click(three_dots)

"choose the edit box"
TestObject button_edit = newTestObject("//table/tbody/tr[3]/td[last()]/div/ul/div/button[normalize-space()='Edit']")
WebUI.waitForElementVisible(button_edit, 10)
WebUI.verifyElementVisible(button_edit)
WebUI.click(button_edit)
WebUI.waitForPageLoad(10)

"replace and verify the text in the English Title box"
TestObject input_Title_EN = newTestObject("id('title_en')")
WebUI.waitForElementVisible(input_Title_EN, 10)
WebUI.verifyElementVisible(input_Title_EN)
WebUI.clearText(input_Title_EN)
WebUI.setText(input_Title_EN, "Donot Delete for automation")
WebUI.verifyElementAttributeValue(input_Title_EN, 'value', "Donot Delete for automation", 10)

"click on the Update button"
TestObject button_Update = newTestObject("//button[normalize-space()='Update']")
WebUI.verifyElementVisible(button_Update)
WebUI.click(button_Update)

WebUI.delay(131)
1 Like

I will try this & get back to you, really thanks for your support :slight_smile:

I tried this script as is, but it failed, it opened the browser and navigated to site URL, but it did not add the user name & password on the login page.
Actually, I created a new tcs manually like the old one that failed but considered statements like:
wait for page load, wait for element visible & verify element visible before clicking 3 dots object & it worked thanks to God :slight_smile:

Here is the screen shot after ur tc script failed

Here is the log viewer after running ur tc script

=============== ROOT CAUSE =====================

For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshooting.html

================================================

06-10-2024 11:56:12 AM Test Cases/News/Edit news (script)

Elapsed time: 23.801s

Test Cases/News/Edit news (script) FAILED.

Reason:

groovy.lang.MissingPropertyException: No such property: Tools for class: Script1717064323078

at Edit news (script).run(Edit news (script):37)

at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)

at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)

at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)

at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)

at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)

at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)

at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:137)

at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:128)

at TempTestCase1718013346928.run(TempTestCase1718013346928.groovy:25)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

It looks like you have Tools.newTestObject(“id(“email”)”). That’s illegal. You cannot use double quotes around double quotes.
What you can do is change one of the pair of double quotes to be single quotes, so your statement becomes:
newTestObject(‘id(“email”)’)
or
newTestObject(“id(‘email’)”)

It looks like password is the same.

Additionally, I had to change the environment from my machine to this forum for you. The Tools class, which is your error above, is in my environment but I moved its method to be at the top of the code, so you would not need the Tools class. Instead, you could simply use “newTestObject”. I edited my code early so that you could just copy it to your test’s Script tab but obviously, not early enough.