Unable to click on object..plz help

Unable to click on object ‘Object Repository/log/Page_PmApp/a_s’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element <a _ngcontent-c6=“” appoutsideclick=“” class=“dropdown-toggle ct-top-dropdown” data-toggle=“dropdown” ng-reflect-ct-class-name=“top_child_menu dropdown-menu p”>… is not clickable at point (1174, 24). Other element would receive the click: <div _ngcontent-c1=“” class=“ct-loader”>…

I’ve had this happen for two different reasons. One, I had a div wrapping the element I wanted to click and was trying to click the div instead. Two, the element isn’t actually visible on the page when you try to apply the click function. To solve the element not visible issue, I used the JavascriptExecutor to click the element via a Custom Keyword script.

shilpa kharat said:

Unable to click on object ‘Object Repository/log/Page_PmApp/a_s’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element <a _ngcontent-c6="" appoutsideclick="" class=“dropdown-toggle ct-top-dropdown” data-toggle=“dropdown” ng-reflect-ct-class-name=“top_child_menu dropdown-menu p”>… is not clickable at point (1174, 24). Other element would receive the click: <div _ngcontent-c1="" class=“ct-loader”>…

Try using custom keyword and JavaScript click

Create custom keyword with this code:

class clickUsingJs {

@Keyword

def clickJS(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)

}

}

Call it like this:

CustomKeywords.‘javaScript.clickUsingJs.clickJS’(findTestObject(‘your_object’), 30)

Note:
javaScript => name of my package when i created new Keyword
clickUsingJs is my Keyword

You could also try waiting until the

element is not present by WebUI.waitForElementNotPresent() if it is temporarily blocking the “view” for the driver to click.