[wtr-general] Re: Locating parent element
Yes i found a soluiton with Xpath: $ie.table(:xpath,//div/h4/div[contains(text(),'ti podaci')]/ parent::*/following-sibling::*/child::table)[1][2].text and i get correct data fom table. br,Dani On 15 nov., 16:37, Danijel danijel.vuko...@gmail.com wrote: Hy, I have to problem find a parent element and search its next sibling. My HTML looks like: .. DIV H4DIVTEST/DIV /H4 DIV Table Tbody TRTD1. Name/TDTDDani/TD/TR /Tbody /Table /DIV /DIV ... this is insert of HTML code from wghich i would like to get values of table. First DIV can be displayed as index 4,5,6. Exists better way to find table element. PRoblem is that i do not have Id, names, classes for same elements are same. i use: puts $ie.h4(:xpath,//h4/ div[contains(text(),'TEST')]).parent.table(//div/table/tbody/tr[1]/ td[1]).text or puts $ie.h4(:xpath,//h4/div[contains(text(),'TEST')]).parent.table(/ div/table/tbody/tr[1]/td[1]).text and i get error message: 1) Error: test_aaa(SMOKE_TEST): Watir::Exception::UnknownObjectException: Unable to locate element, using //div/table/tbody/tr[1]/td[1] D:/avtomatizacija/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ element.rb:58:in `assert_exists' D:/avtomatizacija/Ruby/lib/ruby/gems/1.8/gems/watir-1.6.7/lib/watir/ element.rb:124:in `text' ./sup.rb:694:in `fn_preberi_dodBDok' jpr_smoke.rb:3542:in `test_aaa' -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir tests - result reporting
Alastair, Stmbled on this: http://www.natontesting.com/2009/09/18/get-html-output-from-testunit-by-using-rspec/ Please see if it would work for you. Thanks, Babitha On Nov 13, 5:44 am, Alastair Montgomery doodl...@gmail.com wrote: Hi, Here is a small sample of the test scripts we are using at the moment, can you tell if there is much work required to change it to RSpec? require rubygems require logger require test/unit require watir require library/CSVRead require library/PARRead require library/Login require library/browseTree class WorkflowSelectorTest Test::Unit::TestCase def setup #Setup Variables myPAR = PARRead.new(001_parameters.txt) #Create log file $log = Logger.new(myPAR.logfile) $log.debug ===Initializing Test Setup=== testSite = myPAR.url title = myPAR.title #Choose Browser Watir::Browser.default = myPAR.browser #Start Test Run $log.debug ===Start=== $log.debug Goto web page, + testSite $browser = Watir::Browser.start(testSite) #Login tmp = Login.new($browser,myPAR.user,myPAR.password) $log.debug Test WebClient Title assert($browser.title.include? title) #Wait for jQuery to render Watir::Waiter.wait_until {$browser.label(:id,acms-ws-select- label).exists?} $log.debug Check workspace label assert($browser.label(:id, acms-ws-select-label).exists?) end def teardown $log.debug ===Test Teardown=== #TODO Logout when implemented in client if $DEBUG then #Do not close the browser puts Finished else $browser.close end $log.close end def testWorkflowSelector1 #Test choosing workspaces myData = CSVRead.new(data/testWorkflowSelector1.csv) workspaceName = myData.array $log.debug ===testWorkflowSelector1=== $log.debug Test choosing workspaces $log.debug Select workflow dropdown check assert($browser.select_list(:id, ACMS-Workspace-Selector)) $log.debug Change workflow dropdown check dropDown = $browser.select_list(:id, ACMS-Workspace-Selector) i=0 while i workspaceName.length dropDown.select workspaceName[i][0] dropDown.set workspaceName[i][0] assert_equal(dropDown.value,workspaceName[i][0]) i+=1 end $log.debug ===testWorkflowSelector1=== end end Regards, Alastair On Nov 12, 1:40 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Fri, Nov 12, 2010 at 12:44 PM, Alastair Montgomery doodl...@gmail.com wrote: Do you need to do any changes to your test scripts to run them with RSpec? It depends. :) If you provide some sample code I could change it to use RSpec. Željko- Hide quoted text - - Show quoted text - -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir tests - result reporting
Željko, Thanks for your replies. But, isn't there any solution that would give an excel report? HTML report, even if color coded, I don't think is easy to run through. Thanks, Babitha On Nov 15, 5:16 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Sat, Nov 13, 2010 at 12:44 PM, Alastair Montgomery doodl...@gmail.com wrote: Here is a small sample of the test scripts we are using at the moment, can you tell if there is much work required to change it to RSpec? I think Dave ported it pretty god to RSpec. Let me know if you have further questions. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Access area element after search results
On Mon, Nov 15, 2010 at 6:36 PM, Dan Claudiu Pop danclaudiu...@gmail.com wrote: I've tried with fire_event, but none of them worked. Sometimes you have to fire two (or more) events one after the other. This is a good time to ask a developer how it works. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir tests - result reporting
On Tue, Nov 16, 2010 at 10:12 AM, Babitha babitha.augus...@gmail.com wrote: But, isn't there any solution that would give an excel report? If you need simple table, you can export data as CSV file. If you need more functionality, take a look at these: http://rasta.rubyforge.org/ http://roo.rubyforge.org/ Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Watir doesn't wait for redirect to complete on IE6
Greetings All, On IE6 when requesting a page that redirects Watir will return imediately. On IE8 Watir will wait for redirect to complete. Did anybody else bump into this? Thanks. -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Watir doesn't wait for redirect to complete on IE6
On Tue, Nov 16, 2010 at 12:05 PM, dimovich dimov...@gmail.com wrote: On IE6 when requesting a page that redirects Watir will return imediately. On IE8 Watir will wait for redirect to complete. Did anybody else bump into this? Please show us the code. So, it works manually, but not from a Watir script? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
It's basically: ie.goto 'page that redirects' ie.link(:id, 'MyLink').click On IE8 the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. On Nov 16, 1:12 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 12:05 PM, dimovich dimov...@gmail.com wrote: On IE6 when requesting a page that redirects Watir will return imediately. On IE8 Watir will wait for redirect to complete. Did anybody else bump into this? Please show us the code. So, it works manually, but not from a Watir script? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
It's basically: ie.goto 'page that redirects' ie.link(:id, 'MyLink').click On IE8 the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. On Nov 16, 1:12 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 12:05 PM, dimovich dimov...@gmail.com wrote: On IE6 when requesting a page that redirects Watir will return imediately. On IE8 Watir will wait for redirect to complete. Did anybody else bump into this? Please show us the code. So, it works manually, but not from a Watir script? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
Sorry for mistakes, it must be: On __IE6___ the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. On Nov 16, 2:06 pm, dimovich dimov...@gmail.com wrote: It's basically: ie.goto 'page that redirects' ie.link(:id, 'MyLink').click On IE8 the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. On Nov 16, 1:12 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 12:05 PM, dimovich dimov...@gmail.com wrote: On IE6 when requesting a page that redirects Watir will return imediately. On IE8 Watir will wait for redirect to complete. Did anybody else bump into this? Please show us the code. So, it works manually, but not from a Watir script? Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Please help me with watir-ruby script
Please help me with code for javascript pop up confirmation box for Fire Fox to click OK button -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Please help me with watir-ruby script
without any code that you've written or html, no one in this forum will be able to help other than refer you to the documentation http://watir.com/documentation/ On Tue, Nov 16, 2010 at 7:28 AM, Robin D'Souza robin.so...@gmail.comwrote: Please help me with code for javascript pop up confirmation box for Fire Fox to click OK button -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Please help me with watir-ruby script
On Tue, Nov 16, 2010 at 1:28 PM, Robin D'Souza robin.so...@gmail.com wrote: Please help me with code for javascript pop up confirmation box for Fire Fox to click OK button Take a look at this: http://wiki.openqa.org/display/WTR/JavaScript+Pop+Ups Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Please help me with watir-ruby script
I used this function def startClicker( button , waitTime = 3) w = WinClicker.new longName = ie.dir.gsub(/ , \\ ) shortName = w.getShortFileName(longName) c = start rubyw #{shortName }\\watir\\clickJSDialog.rb #{button }#{ waitTime} puts Starting #{c} w.winsystem(c ) w=nil end and called the function when pop up was appeared startClicker(OK) which did not work.. it gave a error as C:/Rubyscripts/new/RegistrationFatcowIE_priya.rb:16:in `startClicker': uninitialized constant WinClicker (NameError) Do i have use different require for WinClicker for FireFox? On Tue, Nov 16, 2010 at 6:11 PM, Basim Baassiri ba...@baassiri.ca wrote: without any code that you've written or html, no one in this forum will be able to help other than refer you to the documentation http://watir.com/documentation/ On Tue, Nov 16, 2010 at 7:28 AM, Robin D'Souza robin.so...@gmail.comwrote: Please help me with code for javascript pop up confirmation box for Fire Fox to click OK button -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comhttp://groups.google.com/group/watir-generalwatir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
If by manually you mean irb then the behaviour stays the same: IE6 - browser reaches page that redirects and Watir returns from goto call without waiting for redirect. IE8 - browser reaches page that redirects and follows the redirect. Watir will return from goto call only after page we have been redirected to has loaded. I'm talking about 302 redirect. On Nov 16, 3:51 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 1:07 PM, dimovich dimov...@gmail.com wrote: On __IE6___ the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. What happens if you thy that manually? Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Call to Arms :)
Taza has generators for each of it's objects, and a clean model for Sites, Pages and Elements. Filters can be applied to elements which we've used extensively for supporting Ajax heavy pages. Take a look at the wiki on github, it explains the basics behind Taza. I've never used Rasta, so I can't really help you there. Cheers, Charley Baker Lead Developer, Watir, http://watir.com On Tue, Nov 16, 2010 at 8:11 AM, Shiv tms...@gmail.com wrote: Hey Charley, I am already using Watir + Rasta for data driven test automation for my application. out of curiosity I have checked the cheesy link you sent to group. few question I have: can I use watir+rasta+taza ? what are the main features of taza framework? Thanks and Regards, Shiv On Tue, Nov 16, 2010 at 8:28 PM, Charley Baker charley.ba...@gmail.com wrote: I went through a couple of iterations of frameworks over the years with the result of lessons learned being designed into Taza. With over 70 testers adding code, I definitely experienced the pain of maintainability which Taza, and other practices were finally able to solve, so I feel your pain. :) Taza has partials for page areas like headers, footers, search, etc that show up on multiple pages. Cheers, Charley Baker Lead Developer, Watir, http://watir.com On Mon, Nov 15, 2010 at 7:26 PM, George george.sand...@gmail.com wrote: One question about Taza: Would this framework be effective for testing the same functionality across multiple pages? IOW, if there is a search feature that needs to be tested, but can be found on multiple pages, would Taza work for my needs? Thanks, George On Nov 15, 5:59 pm, George george.sand...@gmail.com wrote: Hi Charley, I might need to talk to you. As I've been learning Watir, I steered away from established frameworks (frankly, out of my lack of understanding) and developed my own framework which included HTML reporting. However, as the number of tests have been increasing and gaining more visibility to others within my team, I'm finding that it's become more difficult to maintain. So, I might need to (gulp) re-structure my tests. I still need to talk to my boss about this, but I'll take a look at those links and develop some simple tests. Hopefully, this will inspire me to adhere to already-established frameworks. -George On Nov 15, 1:34 pm, Charley Baker charley.ba...@gmail.com wrote: This might help some of you and definitely worth checking out :http://www.cheezyworld.com/ He has a couple of pages now on cucumber and browser testing, developing a page based framework. Tazahttps://github.com/scudco/tazaisa framework I've architected and used in several large companies, which has many of the same concepts that people are moving towards - e.g. page and site models. Please do check these out, use them and try not to reinvent your own framework. Ruby has builtin support for a base test library - a few of us have added additional test frameworks on top of that which are used in heavy large scale application testing with AJAX and all the goodness from years of experience. Cheezy's posts are a build up of real life experience using Watir and Cucumber on various client sites. I'd highly recommend following them, there are several more coming. I'll drop a hint, Taza is an awesome framework for web ui testing, well used and also extensible. If you want to get involved in either Taza or Watir, we've got a lot of work to do, and I'm happy to mentor from the newbie on up. Cheers, Charley -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
I'd add a wait_until on the element, so that you're sure it's available before clicking it. I've not had any problems with redirects with IE6, so not sure why that's happening, but the wait_until should guarantee that the element's there. Charley Baker Lead Developer, Watir, http://watir.com On Tue, Nov 16, 2010 at 8:20 AM, dimovich dimov...@gmail.com wrote: If by manually you mean irb then the behaviour stays the same: IE6 - browser reaches page that redirects and Watir returns from goto call without waiting for redirect. IE8 - browser reaches page that redirects and follows the redirect. Watir will return from goto call only after page we have been redirected to has loaded. I'm talking about 302 redirect. On Nov 16, 3:51 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 1:07 PM, dimovich dimov...@gmail.com wrote: On __IE6___ the 'click' call will fail because Watir cannot find the link (redirect hasn't finished yet so this is expected). On IE8 everything works just fine. What happens if you thy that manually? Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Call to Arms :)
Hey Charley, I am already using Watir + Rasta for data driven test automation for my application. out of curiosity I have checked the cheesy link you sent to group. few question I have: can I use watir+rasta+taza ? what are the main features of taza framework? Thanks and Regards, Shiv On Tue, Nov 16, 2010 at 8:28 PM, Charley Baker charley.ba...@gmail.comwrote: I went through a couple of iterations of frameworks over the years with the result of lessons learned being designed into Taza. With over 70 testers adding code, I definitely experienced the pain of maintainability which Taza, and other practices were finally able to solve, so I feel your pain. :) Taza has partials for page areas like headers, footers, search, etc that show up on multiple pages. Cheers, Charley Baker Lead Developer, Watir, http://watir.com On Mon, Nov 15, 2010 at 7:26 PM, George george.sand...@gmail.com wrote: One question about Taza: Would this framework be effective for testing the same functionality across multiple pages? IOW, if there is a search feature that needs to be tested, but can be found on multiple pages, would Taza work for my needs? Thanks, George On Nov 15, 5:59 pm, George george.sand...@gmail.com wrote: Hi Charley, I might need to talk to you. As I've been learning Watir, I steered away from established frameworks (frankly, out of my lack of understanding) and developed my own framework which included HTML reporting. However, as the number of tests have been increasing and gaining more visibility to others within my team, I'm finding that it's become more difficult to maintain. So, I might need to (gulp) re-structure my tests. I still need to talk to my boss about this, but I'll take a look at those links and develop some simple tests. Hopefully, this will inspire me to adhere to already-established frameworks. -George On Nov 15, 1:34 pm, Charley Baker charley.ba...@gmail.com wrote: This might help some of you and definitely worth checking out : http://www.cheezyworld.com/ He has a couple of pages now on cucumber and browser testing, developing a page based framework. Tazahttps:// github.com/scudco/tazaisa framework I've architected and used in several large companies, which has many of the same concepts that people are moving towards - e.g. page and site models. Please do check these out, use them and try not to reinvent your own framework. Ruby has builtin support for a base test library - a few of us have added additional test frameworks on top of that which are used in heavy large scale application testing with AJAX and all the goodness from years of experience. Cheezy's posts are a build up of real life experience using Watir and Cucumber on various client sites. I'd highly recommend following them, there are several more coming. I'll drop a hint, Taza is an awesome framework for web ui testing, well used and also extensible. If you want to get involved in either Taza or Watir, we've got a lot of work to do, and I'm happy to mentor from the newbie on up. Cheers, Charley -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.comwatir-general%2bunsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
On Tue, Nov 16, 2010 at 4:20 PM, dimovich dimov...@gmail.com wrote: If by manually you mean irb No, I mean by doing it without Watir. Open browser, go to the page with IE6 and see does it redirect. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
Yes, IE6 redirects just fine. On Nov 16, 5:31 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 4:20 PM, dimovich dimov...@gmail.com wrote: If by manually you mean irb No, I mean by doing it without Watir. Open browser, go to the page with IE6 and see does it redirect. Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
Re: [wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
On Tue, Nov 16, 2010 at 4:44 PM, dimovich dimov...@gmail.com wrote: Yes, IE6 redirects just fine. Did you try waiting as Charley said? More info: http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
The thing is that sometimes the page redirects to some of our internal Error Pages and that's ok if the links are missing... We're expecting the exceptions. But adding special logic to handle all those little redirect exceptions for all the pages is too much. I'm better off adding a sleep 30 after goto and hope that it redirects in the meantime :). I will investigate further this issue and see if I find anything useful. On Nov 16, 5:46 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 4:44 PM, dimovich dimov...@gmail.com wrote: Yes, IE6 redirects just fine. Did you try waiting as Charley said? More info: http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Watir doesn't wait for redirect to complete on IE6
Ok... I think I figured it out. This wasn't the default IE6 behaviour. Windows Update installed some patches that didn't require a reboot... and IE got to behave this way... A reboot fixed it, but I think this should raise some questions. On Nov 16, 6:32 pm, dimovich dimov...@gmail.com wrote: The thing is that sometimes the page redirects to some of our internal Error Pages and that's ok if the links are missing... We're expecting the exceptions. But adding special logic to handle all those little redirect exceptions for all the pages is too much. I'm better off adding a sleep 30 after goto and hope that it redirects in the meantime :). I will investigate further this issue and see if I find anything useful. On Nov 16, 5:46 pm, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Tue, Nov 16, 2010 at 4:44 PM, dimovich dimov...@gmail.com wrote: Yes, IE6 redirects just fine. Did you try waiting as Charley said? More info: http://wiki.openqa.org/display/WTR/How+to+wait+with+Watir Željko -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Playback browser in fixed size.
tell the browser to go to this 'URL' or one like it: javascript:window.resizeTo(1024,768) (hopefully the site won't think I'm trying to do some kind of cross site attack) I have some favorites of that sort setup so I can resize the browser when doing manual testing, most of the time i find that's where it matters because it's really hard to script for checks of how the site 'appears' on a given sized browser (and not have the test break at the slightest site re-design) your milage may vary, but for me most stuff related to the size of the browser window is 'astentic' not functional. it's still important to test depending on what our minimum supported sizes are, but very hard to automate (as are most usability or lookfeel type issues) so often more productive to just test manually On Nov 15, 1:16 am, Željko Filipin zeljko.fili...@wa-research.ch wrote: On Mon, Nov 15, 2010 at 7:00 AM, sharkman72 ilol...@gmail.com wrote: Does any one know how to open a browser in playback as a fixed size? Ex: set certain hieght/width dimensions. I set up browser size and position manually, close it manually, open it with Watir, and it opens with exactly same position and size as I have just closed it. Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com
[wtr-general] Re: Unable to call ruby script multiple times!!
I think you are basically abusing a bit of a fluke in the way that 'require' works with an interpreted language like ruby. By design it's only going to 'execute' the 'require' step once, even if the flow of the script causes it to be encoutered many times. That's because what 'require' is doing is pulling in the code in the specified file, parsing it to define methods and such that it expects you to call from your main script. Because you have code not inside a method, it ends up getting executed. But Require is not intended as a way to execute code, but a way to bring in methods (aka functions, code libraries etc) that you are going to call from your script. So seriously, STOP using require that way or I'm going to get out the giant psycic 'STOP THAT!' cannon and point it in your direction. that's NOT how it's done, even if you think it's working for you, STOP IT!.. If you want to do things this way you are going to have to define almost the entire contents of those other files as a method by putting a 'def methodname (parameters)' statement very near the top, and an END down at the bottom. Then you can call that method. READ THIS: http://ruby-doc.org/docs/ProgrammingRuby/html/tut_methods.html My example presumed that you were defining the other scripts as methods. it then CALLED those methods inside a loop to execute them multiple times If you have code you need to use in multiple places, or to call over and over, this is generally how it's done.. define the code as a method, require the file that has that method in it. call the method when/where needed. Many times methods are associated with objects, and are designed so the object can do appropriate things (a bit like telling the dishwasher to start the wash cycle, or asking a dish 'are you dirty?') but I'm getting into the idea of object oriented programming and that's a bit beyond the scope here. For the moment all that's important is to understand that making those other scripts into methods, and then calling the methods is the way to go here. You can also try Load as Zeljko suggests That might look something like: 10.times do load 'Ft_001' end Either way, It seems you need to learn a bit more about the Ruby language. I'd recommend reading the ebook that ruby installs as part of it's help, or getting a copy of a good tutorial such as 'Everyday scripting with Ruby' I find the 'veryday scripting' book to be ideal for testers, many of the examples are useful on your regular work. On Nov 14, 6:29 am, chethan sarathy chethan2...@yahoo.co.in wrote: Hi Thanks for Helping me on this, Sorry I couldn't give you full picture, I have made my test case in one script .rb file i will Call using require command Some thing like this require ' TestCase_001' require 'TestCase_002' These will be ran through one .rb file This will run perfectly but I got only one problem I am not able to run these test cases multiple times. I tried your idea of (10.times do) still unlucky :( Thanks again, Chethan --- On Fri, 12/11/10, Chuck van der Linden sqa...@gmail.com wrote: From: Chuck van der Linden sqa...@gmail.com Subject: [wtr-general] Re: Unable to call ruby script multiple times!! To: Watir General watir-general@googlegroups.com Date: Friday, 12 November, 2010, 1:49 PM In Ft_001 wrap all your code in a method definition def Ft_001 rest of the script code here end The for the other script do this require 'Ft_001' 10.times do Ft_001() end If you need to sleep after the execution you can put that in. If you need to use the value of 'i' inside your script then it changes only a little First, Your definition needs to contain i def Ft_001(i) Then the calling script then looks like this require 'Ft_001' 10.times do |i| Ft_001(i) end On Nov 11, 11:35 pm, chethan sarathy chethan2...@yahoo.co.in wrote: here is my code @i = 1 begin require 'Ft_001' # This is my script sleep(10) @i = @i+1 end while @i 10 Thanks, Chethan --- On Wed, 10/11/10, Željko Filipin zeljko.fili...@wa-research.ch wrote: From: Željko Filipin zeljko.fili...@wa-research.ch Subject: Re: [wtr-general] Unable to call ruby script multiple times!! To: watir-general@googlegroups.com Date: Wednesday, 10 November, 2010, 2:28 PM On Wed, Nov 10, 2010 at 6:16 AM, Chethan chethan2...@gmail.com wrote: But I am unable to execute multiple times. Show us the code. Željko -- watir.com - community manager watirpodcast.com - host testingpodcast.com - audio podcasts on software testing. all of them -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice. watir-general@googlegroups.com http://groups.google.com/group/watir-general watir-general+unsubscr...@googlegroups.com -- Before posting, please readhttp://watir.com/support. In short: search before you ask, be nice.