You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@param key code for keys see http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.awt.event.KeyEvent.CHAR_UNDEFINED
*/
public void pressKeyNative(final String locator, final String key) {
if (locator == null || key == null) {
info("Keyword needs locator and key => FAILED");
throw new Selenium2LibraryNonFatalException(
"Keyword needs locator and key => FAILED");
}
final List element = elementFind(locator, true, true);
element.get(0).sendKeys(key);
}
The text was updated successfully, but these errors were encountered:
Add to Element.java a new keyword Press Key Native. Prototype see below.
Goal: Elements like scrollbar are not coded in html. Therefore a locator can only hit the whole element and not single control elements. Keys like page up/down can be used instead.
The keyword Press Key only accepts ASCII characters. To use other keys (see http://docs.oracle.com/javase/6/docs/api/constant-values.html#java.awt.event.KeyEvent.CHAR_UNDEFINED) a native version is necessary.
Additional the same keyword without locator could be useful. Compare http://robotframework-seleniumlibrary.googlecode.com/hg/doc/SeleniumLibrary.html?r=2.5#Press%20Key%20Native
/**
*/
public void pressKeyNative(final String locator, final String key) {
if (locator == null || key == null) {
info("Keyword needs locator and key => FAILED");
throw new Selenium2LibraryNonFatalException(
"Keyword needs locator and key => FAILED");
}
final List element = elementFind(locator, true, true);
element.get(0).sendKeys(key);
}
The text was updated successfully, but these errors were encountered: