当我点击该区域时没有显示正确的文字

时间:2016-06-03 15:37:54

标签: java selenium xpath automation

点击该区域的方法是:

public CovTextContentDialog goToCovTextContentDialog(int index) {
    log.info("Click on Text area inside of preview");
    String parentWindowHandle = driver.getWindowHandle();
    WebElement textAreaElement;
    CovTextContentDialog covTextContentDialog;
    try {
        wait.until(ExpectedConditions
            .frameToBeAvailableAndSwitchToIt(contentFrameBy));            
        wait.until(ExpectedConditions
            .visibilityOfElementLocated(getTextImageAreaByIndexBy(index)));
        textAreaElement = driver.findElement(By.xpath(
            "//div[@id='detailscontent']/map/area[contains(@href, 'geomOrder=" + index + "&')]"));
        textAreaElement.click();

显示的文字是geomOrder 16,但应该显示 the text of geomOrder 14

有没有其他方法可以点击正确的区域?

0 个答案:

没有答案