Verify element visible


#1

I want to verify element present or not with if statement. if(

WebUI.verifyElementVisible(object’)) == true){do someyhing} else {do something}

Katalon detects that the object is visible, actually the object is not visible, so katalon always run if statement. How to verify if the object is not visible and katalon can run else statement?


#2

Well, maybe you could add delays or wait for element visible before checking. I also sometimes get suspicous results. Try experimenting with

WebUI.waitForElementVisible(), 
WebUI.verifyElementPresent(),
WebUI.verifyElementInViewport()

#3

Mate Mrse said:

Well, maybe you could add delays or wait for element visible before checking. I also sometimes get suspicous results. Try experimenting with

WebUI.waitForElementVisible(), 

WebUI.verifyElementPresent(),
WebUI.verifyElementInViewport()


  

  

Hi mate,

I’ve tried using it, but it doesn’t work on me and I get this error

Object ‘Object Repository/GFF/Home’ is present but is not visible in viewport.
it should be if the if statement invalid will execute the else statement, but only stop at the if statement and my test case failed
is there another solution?