How to click a href link using Selenium

前端 未结 10 1236
悲哀的现实
悲哀的现实 2020-12-09 09:48

I have a html href link

App Configuration

using Selenium I need

10条回答
  •  天涯浪人
    2020-12-09 10:39

    Use

    driver.findElement(By.linkText("App Configuration")).click()
    

    Other Approaches will be

    JavascriptLibrary jsLib = new JavascriptLibrary(); 
    jsLib.callEmbeddedSelenium(selenium, "triggerMouseEventAt", elementToClick,"click", "0,0");
    

    or

    ((JavascriptExecutor) driver).executeScript("arguments[0].click();", elementToClick);
    

    For detailed answer, View this post

提交回复
热议问题