[wtr-general] Re: How to run 2 different scripts at the same time?
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 -~--~~~~--~~--~--~---
[wtr-general] Re: How to run 2 different scripts at the same time?
This is just gr8. It works Thanks Dylan - zakir On Tue, Aug 11, 2009 at 11:31 AM, Dylan mej...@gmail.com wrote: 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? -- Best Regards zakir --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How to run 2 different scripts at the same time?
You can do this in ruby with threads (http://ruby-doc.org/core/classes/ Thread.html) although you need to be very careful that the two threads don't interfere. -Dylan On Aug 10, 7:44 pm, Marlon marlonmoja...@gmail.com wrote: Hi, anyone here knows how to run multiple scripts at the same time? I wanted run for example 2 different scripts concurrently, Thanks in advance --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
[wtr-general] Re: How to run 2 different scripts at the same time?
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 -~--~~~~--~~--~--~---