Selenium click event does not trigger angularjs ng-click

后端 未结 6 1382
眼角桃花
眼角桃花 2020-12-16 00:50

I have this page where there is a textbox and there is save button associated with each text box. I need to click on the save button so that it will save the value in text b

6条回答
  •  难免孤独
    2020-12-16 01:19

    Replace the locator according to your convenience

    WebElement element= driver.findElement(By.id("btnkbaemailauthsub"));
    
    JavascriptExecutor executor = (JavascriptExecutor) driver;
    executor.executeScript("arguments[0].click();", element);
    

    OR

    JavascriptLibrary jsLib = new JavascriptLibrary();
    jsLib.callEmbeddedSelenium(driver,"triggerMouseEventAt", element,"click", "0,0");
    

    OR

    WebElement element= driver.findElement(By.id("btnkbaemailauthsub"));
    // Configure the Action
    Actions action = new Actions(driver);
    
    //Focus to element
    action.moveToElement(element).perform();
    
    // To click on the element
    action.moveToElement(element).click().perform();
    

    Hope it will help you :)

    Get back to me if still facing issue :)

提交回复
热议问题