String xpath = "//*[@id='samples-grid']/table/tbody/tr/td [last()]";
WebElement e = getWebDriver().findElement(By.xpath(xpath));
sendKeysByJavascriptAndTriggerEvents(e,keysToSend);
private void sendKeysByJavascriptAndTriggerEvents(WebElement webElement, String keysToSend) {
// trigger the change event.
executeWebDriverJS(webElement, "$(arguments[0]).change(); return true;");
// trigger the blur and keyup to simulate keypresses.
executeWebDriverJS(webElement, "$(arguments[0]).blur(); return true;");
executeWebDriverJS(webElement, "$(arguments[0]).keyup(); return true;");
// clicking away from an element can trigger an event.
getWebDriver().findElement(By.tagName("body")).click();
Actions act = new Actions(getWebDriver());
act.moveToElement(e).doubleClick(e).build().perform();
act.sendKeys(e, Keys.TAB).build().perform();
act.contextClick(e).release(e);
act.sendKeys(e,Keys.ENTER).build().perform()
At Run time only this text is becoming Input type and I am using Action API for double click then entering Key.
String xpath = "//*[@id='samples-grid']/table/tbody/tr/td [last()]";
WebElement e = getWebDriver().findElement(By.xpath(xpath));
e.sendKeys(keysToSend + "\n");
e.sendKeys(Keys.TAB);
The problem is here focus still remain on input box only. Is there any way to get mouse cursor in the end of entered keys?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0633d0b4-8a3d-4763-a5a2-b63e0f880faf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
String xpath = "//*[@id='samples-grid']/table/tbody/tr/td [last()]/span[1]/span/input[1]";
WebElement e = getWebDriver().findElement(By.xpath(xpath));
Actions act = new Actions(getWebDriver());
act.moveToElement(e).click();
e.clear();
// e.sendKeys(keysToSend, Keys.ENTER);
act.keyDown(e,Keys.CONTROL);
act.sendKeys(e,keysToSend);
act.keyUp(e,Keys.ENTER);
act.doubleClick(e).contextClick().build().perform()
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/5f5cba3a-3080-4f2a-a85b-c06c5d92a694%40googlegroups.com.
public void setPresetsTextName(String keysToSend) {
String xpath = "//*[@id='samples-grid']/table/tbody/tr/td [last()]/span[1]/span/input[1]";
WebElement e = getWebDriver().findElement(By.xpath(xpath));
Actions act = new Actions(getWebDriver());
act.moveToElement(e).doubleClick(e).build().perform();
e.clear();
e.sendKeys(keysToSend ,Keys.TAB );
}
What's the error?
Why can't we just say e.sendkeys("text"+Keys.TAB)?
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/16fcc239-6767-44b1-88c1-c2ce9583a116%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.