Test Cases/New Test Case FAILED because (of) java.lang.NullPointerException

Test Cases/New Test Case FAILED because (of) java.lang.NullPointerException

newpackage.newkeyword.clickUsingJS2:64

newpackage.newkeyword.invokeMethod:0

Test Cases/New Test Case.run:35

this is the line 64

CustomKeywords.'newpackage.newkeyword.clickUsingJS2'(findTestObject('Page_/a_Logout'), 30)

this is the class clickUsingJS2

public class newkeyword {
@Keyword
def clickUsingJS2(TestObject to, int timeout) {
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(to, timeout)
JavascriptExecutor executor = ((driver) as JavascriptExecutor)
executor.executeScript('arguments[0].click()', element)
}
}

Thanks for future help. Good day

Are you sure the ‘Page_/a_Logout’ element exists on the page in the moment it is being called?

Because, that’s what the error message is suggesting.

Thanks for your answer, I already double check all, it is now working

Thanks for the BA.