I'm having some trouble with an element not being able to be located using an xpath and was looking for some input if anyone may know what the problem might be. This is the element that I'm trying to access.
<body id="tinymce">
<p>
<img class="some-class-name" src="/path/to/url" data-macro-name="macro-name" data-macro-
parameters="macro|params" data-macro-schema-version="1">
<span id="_caret" data-mce-bogus="true" style=""><u></u></span>
</p>
</body>
and this is the pageobject code that I have to find and use it.
@FindBy(xpath = "//*[@id=\"tinymce\"]/p/img")
private WebElement cnfGraph;
public void verifyGraphEditPresent() {
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.visibilityOf(cnfGraph));
}
I keep getting the following error
no such element: Unable to locate element: {"method":"xpath","selector":"//*[@id="tinymce"]/p/img"}
I've tried also changing the locator to the class name of the image or the id of the body, but nothing's picking it up.
Any help or advice is appreciated. Thanks