Did you look at the link I posted? It shows you how to do this.

Here's an example for running two google searches at the same time:

require 'watir'
require 'watir/ie'

  def test_google1
    ie = Watir::IE.start('http://www.google.com')
    ie.text_field(:name, "q").set("Test")
    ie.button(:value, "Google Search").click
    ie.close
  end

  def test_google2
    ie = Watir::IE.start('http://www.google.com')
    ie.text_field(:name, "q").set("Other Test")
    ie.button(:value, "Google Search").click
    ie.close
  end

  threads = []
  threads << Thread.new{test_google1}
  threads << Thread.new{test_google2}
  threads[0].join
  threads[1].join


-Dylan

On Aug 10, 10:30 pm, Marlon <marlonmoja...@gmail.com> wrote:
> for example:
>
> require 'thread'
> require 'watir'
>
> class search
>   def test_google
>     ie = Watir::IE.start('http://www.google.com')
>     ie.text_field(:name, "q").set("pickaxe")
>     ie.button(:value, "Google Search").click
>     ie.close
>   end
>
>   def test_yahoo
>     ie = Watir::IE.start('http://www.google.com')
>     ie.text_field(:id, "p").set("pickaxe")
>     ie.button(:id, "searchsubmit").click
>     ie.close
>   end
> end
>
> threads = []
>
> how can I run this 2 def at the same time?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to