I'm new to Selenium and needs help with finding the xpath of particular tag to get it clicked.
I want to click SOQL Query link from the highlighted drop-down menu as given in below image:
This is the code what i have tried so far :
//hovering
WebDriverWait wait = new WebDriverWait(driver,20);
//First click on dropdown down to open options
wait.until(ExpectedConditions.elementToBeClickable(By.cssSelector("li.top > a.top_link"))).click();
//Now select opened option
wait.until(ExpectedConditions.elementToBeClickable(By.linkText("a[href*='query.php']"))).click();
Use the Action class to handle such menu click
WebElement queriesLink = driver.findElement(By.cssSelector("li.top > a.top_link"));
WebElement soqlQueryLink = driver.findElement(By.xpath("//li/a[contains(.,'SOQL Query')]"));
Actions action = new Actions(driver);
action.moveToElement(queriesLink ).clickAndHold(soqlQueryLink ).click().build().perform();
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.