On Thu, Apr 21, 2011 at 5:07 PM, the_zonker <the.zonk...@gmail.com> wrote:
> Environment:
> watir-webdriver 2.0.0
> Ruby 1.9.2
> Firefox 3.6, IE8
>

It's a good practice to always try the latest released version before
reporting issues. watir-webdriver is currently at 0.2.2.

> I faced with a problem - I need to put a content of XML file into text
> area.
> The content  is quite long and the process of filling is extremely
> slow.
>
> This slowness of filling causes a timeout error:

How long is the string? WebDriver simulates native key presses on some
platforms (like Windows), which may be slow.

>
>
> For putting value into text area I use:
>  text_area.set(value)
>
> Are there any other ways to fill in text area more quick?
> I tried Javascript via execute_script method but JavaScript cannot
> handle XML content (probably because of quotes) as a valid element
> value.

Using execute_script should work. If you could provide an example
string where it doesn't work, I could probably help you out. Another
approach is to do what a user would do: paste in the XML from the
clipboard. If you have the XML content on the clipboard, you should be
able to do that by sending Control-V:

  text_area.send_keys [:control, 'v']

Jari

PS. The full list of keys you can send can be found here:
http://selenium.googlecode.com/svn/trunk/rb/lib/selenium/webdriver/common/keys.rb

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com

Reply via email to