[Wtr-general] FireWatir for 64bit Fedora 7
Hello, guys. I've been setting up environment for a couple of days. Using IE thought Wine on Fedora works fine, But when using FireWatir, jssh extensions really block me. I downloaded a jssh.xpi and load into Firefox, but it doesn't work. My guess would be jssh is in c++, and have to be recompiled on x86_64 arc again. Here comes a nightmare, I tried to recompile Firefox with support of jssh, but a lot of dependencies show up. Then I tried to compile a xpi directly from jssh code, but couldn't figure out how. Is there any body familiar with jssh compile to XPI or where can I get a 64bit jssh XPI? Thanks for everyone Jarodzz ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Multiple threads and the find file dialog box - failure to select the file
I've got some simple thread code, included below, which will attempt to process every file it finds in a particular directory in a new thread within my application under test. This is essentially some very light load testing. (Obviously I've left a lot of the code out, but there's enough to get the idea below.) Unfortunately, this only appears to function for 1, or if I'm lucky, 2, files. Essentially the first thread will set the file_field, but each subsequent thread (if attempting to input the file_field at roughly the same time) will fail to input the 'inputfile'. It opens the standard Windows find file dialog, but won't select the file. It simply hangs, as though it doesn't know which one to select (even though the inputfile variable is still valid at this stage), or fails to select it. def asset_transform(inputfile) # lots of other stuff regarding browsing the aut included in here ie.file_field(:id,'item_file').set(inputfile) end source_dir=File.dirname(__FILE__) + '/files_to_upload/' threads = [] (Dir[source_dir+*.*]).each do |each_file| each_file.gsub!('/','\\') threads Thread.new {asset_transform(each_file)} end threads.each {|x| x.join} What could be behind this? Is it a problem with threads and the find file dialog box? Are threads not the best way to approach something like this? Do I need to be smarter with my threads, in a way I don't know? Is there a better method for the 'load' testing I'm attempting? - J ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to select an item using select_list
On 7/18/07, rvishnubhotla [EMAIL PROTECTED] wrote: option value=16nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Catalyst 6500/option Hi Radha, There is ten spaces before Catalyst 6500, that is why ie.select_list(:name, productId).select(Catalyst 6500) did not work. I thought this would work, but it does not. ie.select_list(:name, productId).select( Catalyst 6500) Fortunately, both of this work. ie.select_list(:name, productId).select(/Catalyst 6500/) ie.select_list(:name, productId).select(\240\240\240\240\240\240\240\240\240\240Catalyst 6500) Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to select an item using select_list
You could have done this also: ie.select_list(:name, productId).select(/Catalyst 6500/i) --Mark From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Željko Filipin Sent: Wednesday, July 18, 2007 2:34 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Unable to select an item using select_list On 7/18/07, rvishnubhotla [EMAIL PROTECTED] wrote: option value=16nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;Catalyst 6500/option Hi Radha, There is ten spaces before Catalyst 6500, that is why ie.select_list(:name, productId).select(Catalyst 6500) did not work. I thought this would work, but it does not. ie.select_list(:name, productId).select( Catalyst 6500) Fortunately, both of this work. ie.select_list(:name, productId).select(/Catalyst 6500/) ie.select_list(:name, productId).select(\240\240\240\240\240\240\240\240\240\240Catalyst 6500) Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to select an item using select_list
Hi Zeljko, Thanks very much. Tried the below as you suggested and it worked. Hurray !!! $ie.select_list(:name, productId).select(/Catalyst 6500/) I actually tried a slight variation of the above before posting which didn't work: = $ie.select_list(:name, productId).select('/Catalyst 6500/') = Tried nbsp but not \240. Just curious what code is 240. did you mean to user Ascii code? Thanks, -Radha ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Dissapearing text fields
I am writing some tests for a web application, and my initial code in one of the tests was something like this: =begin setup code and includes/requires watir =end =begin other tests needed to get to this point =end def FileCompanyInfo if $browser.text_field(:name, 'Name').exists? then if $broswer.text_field(:name, 'Name').verify_contains() then $browser.text_field(:name, 'Name').set(::CLIENTNAME) $browser.text_field(:name,'Addr1').set(::CLIENTADDR1) =begin Code to fill in rest of form =end end end end And this works beautifully. So next step was to add in some assertions and actual make the tests useful. The code then becomes: =begin setup code and includes/requires watir, test/unit and test/unit/ui/console/testrunner =end class TC_myTests Test::Unit::TestCase =begin other tests needed to get to this point =end def test_FileCompanyInfo assert($browser.text_field(:name, 'Name').exists?) if $broswer.text_field(:name, 'Name').verify_contains() then $browser.text_field(:name, 'Name').set(::CLIENTNAME) $browser.text_field(:name,'Addr1').set(::CLIENTADDR1) =begin Code to fill in rest of form =end end end end And this doesn't work - the assertion fails. I have a couple of other tests before this that work just fine, as those are testing the process of navigating to this page. The assertions in those work are working as expected. I've tried accessing these text boxes by name, by index and by aftertext, and when I have the class in place, it's as if the fields do not exist (even though I can open the source and see that it does indeed exist) I am new to Ruby and watir, though I am familiar with several other languages. What would cause these text fields to become invisible when I add this class definition around the set of methods? I've looked at the documentation and several examples, and as far as I can tell, it should work still. If anyone could point out what I am missing or what I have done wrong, I'd greatly appreciate it as my project and learning have ground to a sudden standstill. Message was edited by: friedbob ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to select an item using select_list
Hi Radha, Comments are inline. On 7/18/07, rvishnubhotla [EMAIL PROTECTED] wrote: Thanks very much. I am glad I could help. :) I actually tried a slight variation of the above before posting which didn't work: = $ie.select_list(:name, productId).select('/Catalyst 6500/') '/Catalyst 6500/' is a string and /Catalyst 6500/ is regular expression. Let me know if you want to know more about the two but can not find good information on line. Just curious what code is 240. I really do not know why Ruby sees space as \240. I did ie.select_list(:name, productId).getAllContents and it returned = [--Select One--, ... \240\240\240\240\240\240\240\240\240\240Catalyst 6500] so I tried ie.select_list(:name, productId).select(\240\240\240\240\240\240\240\240\240\240Catalyst 6500) Let me know if you want to learn how you could do it yourself. Zeljko ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to select an item using select_list
I don't think you are supposed to put single quotes around the regular expression. --Mark -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of rvishnubhotla Sent: Wednesday, July 18, 2007 10:29 AM To: wtr-general@rubyforge.org Subject: Re: [Wtr-general] Unable to select an item using select_list Hi Zeljko, Thanks very much. Tried the below as you suggested and it worked. Hurray !!! $ie.select_list(:name, productId).select(/Catalyst 6500/) I actually tried a slight variation of the above before posting which didn't work: = $ie.select_list(:name, productId).select('/Catalyst 6500/') = Tried nbsp but not \240. Just curious what code is 240. did you mean to user Ascii code? Thanks, -Radha ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Dissapearing text fields
I assume you say that this line fails: assert($browser.text_field(:name, 'Name').exists?) in test_FileCompanyInfo Tricky... Are there other def test_ in the class? My immediate hunch is that tests run alphabetically and not sequentially if you have more than one. could be that the test runs before you get to the page and assert fails. What happens if you just run the class TC_ with only this one test_ . Set up manually and just run the class structure with that one test Does this work when you are on the page? class TC_myTests Test::Unit::TestCase def setup #init $browser here end def test_FileCompanyInfo assert($browser.text_field(:name, 'Name').exists?) end end On 7/18/07, Lee [EMAIL PROTECTED] wrote: I am writing some tests for a web application, and my initial code in one of the tests was something like this: =begin setup code and includes/requires watir =end =begin other tests needed to get to this point =end def FileCompanyInfo if $browser.text_field(:name, 'Name').exists? then if $broswer.text_field(:name, 'Name').verify_contains() then $browser.text_field(:name, 'Name').set(::CLIENTNAME) $browser.text_field(:name,'Addr1').set(::CLIENTADDR1) =begin Code to fill in rest of form =end end end end And this works beautifully. So next step was to add in some assertions and actual make the tests useful. The code then becomes: =begin setup code and includes/requires watir, test/unit and test/unit/ui/console/testrunner =end class TC_myTests Test::Unit::TestCase =begin other tests needed to get to this point =end def test_FileCompanyInfo assert($browser.text_field(:name, 'Name').exists?) if $broswer.text_field(:name, 'Name').verify_contains() then $browser.text_field(:name, 'Name').set(::CLIENTNAME) $browser.text_field(:name,'Addr1').set(::CLIENTADDR1) =begin Code to fill in rest of form =end end end end And this doesn't work - the assertion fails. I have a couple of other tests before this that work just fine, as those are testing the process of navigating to this page. The assertions in those work are working as expected. I've tried accessing these text boxes by name, by index and by aftertext, and when I have the class in place, it's as if the fields do not exist (even though I can open the source and see that it does indeed exist) I am new to Ruby and watir, though I am familiar with several other languages. What would cause these text fields to become invisible when I add this class definition around the set of methods? I've looked at the documentation and several examples, and as far as I can tell, it should work still. If anyone could point out what I am missing or what I have done wrong, I'd greatly appreciate it as my project and learning have ground to a sudden standstill. Message was edited by: friedbob ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Dissapearing text fields
I did some other searches, and found something that said that test runner executes them randomly, so I renamed my tests like it had suggested , test_000_name1 test_001_name2 etc to force the ordering, and it worked. There were multiple tests, but they had to be run in sequence. Thanks, that did the trick. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Dissapearing text fields
On 7/18/07, Lee [EMAIL PROTECTED] wrote: I did some other searches, and found something that said that test runner executes them randomly, well, not 'randomly' but alphanumerically. test unit is built in a such a way as not to introduce dependency between tests in a test case class. That works for Unit tests but for our functional unit tests we need sequential execution sometimes. Please take a look at Watir::TestCase class. By default it sets up execution of tests sequentially. Maybe this should be added to FAQ on Watir site or a section on TestUnit. So instead of doing this: require 'test/unit' class TC_myTests Test::Unit::TestCase do this: require 'watir/testcase' class TC_myTests Watir::TestCase and all your tests run sequentially. --marekj so I renamed my tests like it had suggested , test_000_name1 test_001_name2 etc to force the ordering, and it worked. There were multiple tests, but they had to be run in sequence. Thanks, that did the trick. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general