Xi Chen wrote:
> I have looked at FAQ about invoking separate IE instances using Watir.
> However I found it doesn't work. For example I tried to open up 10
> different browser with a textfield in each of them. I tried to write
> some text in the text_field. All the text are writen into the textfield
> in the last IE.

Hi,

If you show us your code, we can tell you what's wrong with it, why it's not 
working.

Here's one way you might have gone wrong:

$ie = Watir::IE.new
$ie.goto "google.com"
$ie.text_field(:name, "q").set "1"
$ie = Watir::IE.new   # <--- same variable, reference to first window lost
$ie.goto "google.com"
$ie.text_field(:name, "q").set "2"
# both end up at google.com.au with "bar" in the text field.

This works fine:

ie_array = Array.new(3) { Watir::IE.new }  # open 3 IE windows
ie_array.each_with_index do |ie, i|
  ie.goto "google.com"
  ie.text_field(:name, "q").set i
end

Cheers,
Dave 

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to