[Wtr-general] get index of element
is it possible to get index of element? eg. is there a method which does logic like this ie.link('name').getIndex() Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] get index of element
I found solusion eg. for links it would be ie.show_links(), this method displayed list which contains such details like index of each link ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] same name of elements
I have a few elements with the same name on the web, I can't catch them just by index, is it possible to catch them somehow? like element.(:name, ). and then the index somehow? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] same name of elements
thanx a lot Bret, that's what I'm asking. I made mistake and misleadyouguys,sorry. I'm looking for linkby text notby name, but I suppose it doesn't matter and similarcodewillwork ie.link(:text = 'linktext',:index = 2).click am I right?Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] same id elements
hi is it possible to catch elements which have same type of id e.g. ie.link(:id, /regularexpression/) and catch the index somehow? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] file download
ok thnx, what a about bigger files? downloading something that is invoked by the link click? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] file download
Can you show me the example of this www:mechanize beacuse i don't know how to do itthnx Luke ___Wtr-general mailing listWtr-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] report failure question?
I just want to make assert of link, after i remove rescue block, assert method works and I can see that test failed on report, but it skips my test case and I wish to avoid it, I want to add some extra information to my logger file when test fails def test_namemethod begin assert($ie.link(:text, 'name_of_link').exists?) # here i want to add some information to my logger when test succed or failed $logger.log('some information') endend#the in the end of file I generate reportsuite = Test::Unit::TestSuite.new(Name of suite) suite NameofMyClass.suite FileUtils.mkdir_p 'report' Test::Unit::UI:: Reporter.run(suite, './report', :html) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] report failure question?
I answer myself I've done something like this:beginassert($ie.link(:text, 'name_of_link').exists?)rescue =e#my extra code to do something when assert failed, then i return exceptionraiseend now it seems to work, does anyone know better way?Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] cell access
Sorry for asking but I can't deal with it, I've got a table on page and I want to get to the cell Action can someone show me how to do it,I can't firgure out and fail all the time table id=form1:ReportUnit:tblDetails style=font-size: 11px;width: 640px class=Tbl border=0 cellpadding=0 cellspacing=0caption id=form1:ReportUnit:tblDetails:_titleBar class=TblTtlTxtDetail /captiontr id=form1:ReportUnit:tblDetails:tableRowGroupS:_columnHeaderBar:0 th id=form1:ReportUnit:tblDetails:tableRowGroupS:colLinkS:_columnHeader class=TblColHdr align=center scope= colspan class=TblHdrTxtAction/span/ th... ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] report failure question?
I have test, I use assert method and in the end I generate report for this test case, the problem is that when I put 'rescue=e' statement I catch exception and report shows that test pass, if I remove rescue block, then in report I have error in appropriate colum, but still when test is suppose to fail, failure column in report is empty, can you tell me how can I get information when test was done and when fail and present it in report? now I put log to file if assert fails Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] file download
is it possible to download a file from page without invoking window to specify name file, path, dialog with save, cancel buttons, can make it automatically, just specify link to a file and path in code ?Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] dynamic tree attributes
I have dynamically generated tree, not like in example, attributes like names and id are half static and half dynamic way - prefixes are static, suffixes depend on records from database, I can't click on such element because of that, do you know if there's a way to handle it with watir? thnx ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] javascript tree
as I try to invoke code to handle javascript tree it doesn't work, can someone check if code in FAQ is alright? thnx ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] javascript functions
I have _javascript_ functions defined on the page, how can I access to it from watir? can some one show me the examplethnxLuke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] creating test suites
require 'stringio' solved the problemthnx Charley ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] test_output
I generate html report by test report package just like in example, now I want to add some extra strings to test_out.txt file generated by report, is there a method to do so?Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] test_output
Thnx I use assertions and now after it succeed or failed i want to generate message to file which will be linked to report default generated by reporter, as I noticed reporter produces a file test_output already linked to report and containing messages from console after compilation, what I want to achieve is to add this message string to that file somehow ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] creating test suites
I practice at ruby and I've done some example test case,now I would like to create test suite and generate reportcan someone look at this code and explain me what's wrong? I still get message :C:/Test/ruby/lib/ruby/site_ruby/1.8/test/unit/ui/reporter.rb:63:in `run': uninitialized constant Test::Unit::UI::Reporter::StringIO (NameError) from C:/Testy/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'from C:/Testy/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'from C:/RadRails/plugins/org.rubypeople.rdt.testunit_0.8.0.604272100PRD/ruby/RemoteTestRunner.rb:260 thnx4helprequire 'watir'include Watirrequire 'test/unit'require 'test/unit/ui/console/testrunner'require 'test/unit/ui/reporter'require 'fileutils'class AttachClassTest::Unit::TestCase def test_example #some code endendbegin Test::Unit::UI::Console::TestRunner.new(AttachClass.suite).start suite = Test::Unit::TestSuite.new suite AttachClass.suite FileUtils.mkdir_p 'build/report' Test::Unit::UI::Reporter.run(suite, 'build/report',:html) end ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] watir examples
hi, I'm looking for some more examples of watir, scripts which would extend those on wtr.rubyforge, are there any other places on net where I can find them, I wish the would apply to Technical Docs on wtr sitethanx 4 help ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] attach
Thnx ZeljkoI had already read these paragraphs before, but still when I try to compile simple code it doesn't work. Let me show you the examples, it fails all the time. Maybe you know what is wrong? require 'watir'include Watirrequire 'test/unit'class AttachClass Test::Unit::TestCase def test_example ie=IE.start(' http://www.popup-killer-review.com/simplepop1.htm') ie2=IE.attach(:title,'Popup window example') endend ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] attach
thnx now it works somehow, but still it's not exectly alright, if I add new line below the before the end of method ex.ie3=IE.start('http//:www.googl.com') somethimes I receive such error message similiar to the previous one Error:test_example(AttachClass):Watir::Exception::NoMatchingWindowFoundException: Unable to locate a window with title of Popup window example C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1208:in `attach_browser_window' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb::in `attach_init' C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1104:in `attach' I use ruby 1.8.5, watir 1.4.1 and wet 0.5, IDE RadRails ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] attach
Thnx, it wasn't syntax error, I haven't forgotten about e in orginal code, I guess it was rather environment error, beceause I checked the code on the other machine anditseemstoworkthnx4help Luke ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general