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
{{ message }}
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.
What steps will reproduce the problem?
- Selenium.type() or Selenium.typeKeys() or WebElement.sendKeys()
All these are using typing key-by-key. And when the amount of text data is large the
typing takes minutes and the execution timeout elapsed. I can increase the execution
Timeout, but the main problem is test execution time.
I think that it's stupid to set text value of an Input (or text area) element typing
key-by-key.
I can also fix this using JS executors and setting the element value directly, but
in this way I can't use the XPath element locators.
Selenium version: 2.11.0 (also with 2.12.0)
OS: XP, also in Gentoo
Browser: FF
Browser version: 7, 8
Reported by stanimir.komitov on 2011-11-18 12:51:32
The text was updated successfully, but these errors were encountered:
Selenium.type() sets the value of a text field directly.
WebDriver.sendKeys() sends key by key to emulate real user interaction. If you want
to put a large amount of text to a field you may paste it from the clipboard, like
a user would do it.
You should put your data on the clipboard first, and then Ctrl-v it to a text area
or an input.
How to put data on the clipboard?
.Net: http://www.c-sharpcorner.com/UploadFile/mahesh/WorkingwithSystemClipboard12032005043903AM/WorkingwithSystemClipboard.aspx
Java: http://www.exampledepot.com/egs/java.awt.datatransfer/ToClip.html
How to insert the data from the clipboard to an element:
element.sendKeys(Keys.CONTROL + "v");
The workaround with Ctrl + V works fine.
About the Selenium.type().
It is calling WebDriver.sendKeys(), which means that it's the same as WebDriver.sendKeys()
and sends key by key to emulate real user interaction. You can check it.
Reported by stanimir.komitov on 2011-11-18 13:32:53
Selenium.type() calls WebDriver.sendKeys() if you use WebDriverBackedSelenium (aka "emulation
mode"). If you use DefaulSelenium, 'type' assigns value directly.
You are right, but I thing the last year the main development of Selenium team is related
to WebDriver, and the Documentation says that the we should use WebDriverBackedSelenium.
You also add the right issue label -> Labels: Component-WebDriver.
Another 'bug' is when using:
element.sendKeys(Keys.CONTROL + "v")
( even if using Keys.chord( Keys.CONTROL, "v" ) ) the Ctrl key is not released correctly
and if you try to click a link after that, the link is opened in a new tab.
This is a simple test - one text field and one link.
Reported by stanimir.komitov on 2011-11-22 12:29:02
Originally reported on Google Code with ID 2876
Reported by
stanimir.komitov
on 2011-11-18 12:51:32The text was updated successfully, but these errors were encountered: