Verify Element Visible Keyword not working with version 5.6 and 5.7

**## Operating System: Windows 10
**

**## Katalon Studio Version:5.6.x 5.7.x
**

## Expected Behavior

**If the element is not visible the keyword should return false.
**

## Actual Behavior

The execution of the testcase hangs up. I have to stop it manually via the stop button.

## Screenshots

The screenshot is showing the steps. We are checking if the button Yes is visible. If it is visible it should click on the button.
At the moment it hangs up at the Verify element visible step when the button is not there.

With version 5.5 the script is working fine, but we would like to use the new feature from 5.7. So can you please maybe help us ?

Thanks :slight_smile:

steps.PNG

1 Like

WebUI.verifyElementVisible method requires timeout to be specified, for example 10 seconds. Have a look at the documentation
https://docs.katalon.com/display/KD/[WebUI]+Verify+Element+Visible

The screenshot you attached does not show clearly how you set the timeout value. Please have a look at Test Case in Script mode.

Thanks for your response. I didn´t add one so far and then it was choosing the default 20 seconds.I now added one: isVisible = WebUI.verifyElementVisible(findTestObject(‘C4C/page_Login/span_Yes’), 10, FailureHandling.OPTIONAL)
When executing the script now an error ocurs

Please show us the error log. Any error messages there?

The console shows the following:

Test Cases/Reusable Cases/C4C/Login FAILED because (of) (Stack trace: groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementVisible() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling, java.lang.Integer) values: [TestObject - ‘Object Repository/C4C/page_Login/span_Yes’, OPTIONAL, …]
Possible solutions: verifyElementVisible(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), verifyElementVisible(com.kms.katalon.core.testobject.TestObject), verifyElementNotVisible(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), verifyElementNotVisible(com.kms.katalon.core.testobject.TestObject)
at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1503)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1489)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at Script1532067281496.run(Script1532067281496.groovy:44)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:99)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:60)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:54)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:45)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1469)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at Script1533548912451.run(Script1533548912451.groovy:27)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:99)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at TempTestCase1537335464854.run(TempTestCase1537335464854.groovy:22)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)
at groovy.lang.GroovyShell.run(GroovyShell.java:518)
at groovy.lang.GroovyShell.run(GroovyShell.java:507)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:653)
at groovy.ui.GroovyMain.run(GroovyMain.java:384)
at groovy.ui.GroovyMain.process(GroovyMain.java:370)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)
at groovy.ui.GroovyMain.main(GroovyMain.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
)

Test Cases/Appointments/C4C/Create_AllDay-wAttnd FAILED because (of) (Stack trace: groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementVisible() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling, java.lang.Integer) values: [TestObject - ‘Object Repository/C4C/page_Login/span_Yes’, OPTIONAL, …]
Possible solutions: verifyElementVisible(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), verifyElementVisible(com.kms.katalon.core.testobject.TestObject), verifyElementNotVisible(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), verifyElementNotVisible(com.kms.katalon.core.testobject.TestObject)
at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1503)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1489)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at Script1532067281496.run(Script1532067281496.groovy:44)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:99)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.doCall(CallTestCaseKeyword.groovy:60)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword$_callTestCase_closure1.call(CallTestCaseKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:54)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.callTestCase(CallTestCaseKeyword.groovy:81)
at com.kms.katalon.core.keyword.builtin.CallTestCaseKeyword.execute(CallTestCaseKeyword.groovy:45)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:53)
at com.kms.katalon.core.keyword.BuiltinKeywords.callTestCase(BuiltinKeywords.groovy:334)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1469)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:53)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:141)
at Script1533548912451.run(Script1533548912451.groovy:27)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:183)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:108)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:294)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:264)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:256)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:200)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:99)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at TempTestCase1537335464854.run(TempTestCase1537335464854.groovy:22)
at groovy.lang.GroovyShell.runScriptOrMainOrTestOrRunnable(GroovyShell.java:263)
at groovy.lang.GroovyShell.run(GroovyShell.java:518)
at groovy.lang.GroovyShell.run(GroovyShell.java:507)
at groovy.ui.GroovyMain.processOnce(GroovyMain.java:653)
at groovy.ui.GroovyMain.run(GroovyMain.java:384)
at groovy.ui.GroovyMain.process(GroovyMain.java:370)
at groovy.ui.GroovyMain.processArgs(GroovyMain.java:129)
at groovy.ui.GroovyMain.main(GroovyMain.java:109)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
)

wrong order of arguments!

com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.verifyElementVisible() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling, java.lang.Integer) values: [TestObject - ‘Object Repository/C4C/page_Login/span_Yes’, OPTIONAL, …]

somewhere in your code is call verifyElementVisible() with argument order TO, FAILURE_HANDLING, TIMEOUT … swap last two

Thanks i changed it to: isVisible = WebUI.verifyElementVisible(findTestObject(‘C4C/page_Login/span_Yes’), FailureHandling.OPTIONAL, 10)

But the same errors are occuring

PLS change as follows and try:

def isVisible = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), 10, FailureHandling.OPTIONAL)

kazurayam said:

PLS change as follows and try:

def isVisible = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), 10, FailureHandling.OPTIONAL)

Unfortunately this also leads to the error message.
It says that the signature does not contain the timeout

can you please post whole script?

Yes but the login data i can´t share because of sensitive data. That is script with the made changes:

'Opens the specified browser'
WebUI.openBrowser('')

'Maximizes the browser window'
WebUI.maximizeWindow()


'Opens the C4C of the System, which is specified in the Profile'
WebUI.navigateToUrl(GlobalVariable.C4C_URL)

'Sets the Username of the user, which is specified in the Profile'
WebUI.setText(findTestObject('C4C/page_Login/input_Username'), GlobalVariable.C4C_userName)

'Sets the password of the user, which is specified in the Profile'
WebUI.setText(findTestObject('C4C/page_Login/input_Password'), GlobalVariable.C4C_password)

'Clicks on the language menu'
WebUI.click(findTestObject('C4C/page_Login/label_Deutsch'))

'Selects English as language'
WebUI.click(findTestObject('C4C/page_Login/li_English'))

'Clicks on the Log On button'
WebUI.click(findTestObject('C4C/page_Login/span_LogOn'))

'Delay of 20 seconds, for loading the C4C'
WebUI.delay(20)

'Checks if the user is logged in multiple times'
def isVisible = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), 10, FailureHandling.OPTIONAL)


'If the user is logged in multiple times execute the following steps'
if (isVisible) {
    'Clicks on Yes for unlock the user'
    WebUI.click(findTestObject('C4C/page_Login/span_Yes'), FailureHandling.OPTIONAL)

    'Delay of 10 seconds, for loading the C4C'
    WebUI.delay(10)
}

'Checks if the user is logged in multiple times'
def isVisible1 = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), 10, FailureHandling.OPTIONAL)


'If the user is logged in multiple times execute the following steps'
if (isVisible1) {
    'Clicks on Yes for unlock the user'
    WebUI.click(findTestObject('C4C/page_Login/span_Yes'), FailureHandling.OPTIONAL)

    'Delay of 10 seconds, for loading the C4C'
    WebUI.delay(10)
}

LoL
WebUI.verifyElementVisible(null, FailureHandling)
DOES NOT have waiting value…
sorry to misslead you
i check directly in Katalon Studio and suggestions don’t show possibility with timeout option … looks like documentation is not correct

My default timeout is 20 seconds. As i said in the first post, since 5.6 the script doesn´t continue execution if the element is not visible in my script. The goal of the last steps of the script is that if the user is logged in multiple times (checks the yes button), then it should click on yes. This yes button shows up either two times or never (user isn´t logged in multiple times). When last case occurs then the script is hanging at the frist verifyElementVisible. My excpected behaviour (which is working at 5.5) is that the steps finds out that the element is not visible (after searching it for 20 seconds) and the variable isVisible is then false.
My colleagues where also able to reproduce the issue

Lisa,
try following:
it seems that parameter for waiting time is not supported in call

def isVisible = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), FailureHandling.OPTIONAL)def isVisible1 = WebUI.verifyElementVisible(findTestObject('C4C/page_Login/span_Yes'), FailureHandling.OPTIONAL)

Previously Mate Mrse talked about documentation error of WebUI.verifyElementVisible()

yup, totally forgot about that

kazurayam said:

Previously Mate Morse talked about documentation error of WebUI.verifyElementVisible()

Inventor of the Morse code? :smiley:

Ah, sorry, I corrected.
But how should I pronounce your Mrse?

Don’t bother… it is not that easy :slight_smile:

Andrej Podhajský said:

Lisa,
try following:
it seems that parameter for waiting time is not supported in call

def isVisible = WebUI.verifyElementVisible(findTestObject(‘C4C/page_Login/span_Yes’), FailureHandling.OPTIONAL)
def isVisible1 = WebUI.verifyElementVisible(findTestObject(‘C4C/page_Login/span_Yes’), FailureHandling.OPTIONAL)


Thanks for the hint. I tried, but this is not working unfortunaly :(