Attempting to create an automated test using Selenium WebDriver. I have a WebElement on the page with a CSS locator:
@FindBy (css = "#FeedbackMessage")
protected WebElement fm;
I also have a method that successfully focuses out of this element:
public void focusout(){
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].blur();", fm);
Now, I am trying to achieve the same result but with an XPath locator. The element's XPath is
//textarea[@id='FeedbackMessage']
.
Simply changing the locator to
@FindBy (xpath = "//textarea[@id='FeedbackMessage']")
protected WebElement fm;
does not work as expected.