[Wtr-general] How To Click On The Image Button...With This html Code?
Hi People.. Heres The Code: tr td height=15/td/tr tr align=left td align=left colspan=2 valign=bottom input border=0 alt=Search src=../images/search_top.gif name=CTL_SUBMIT type=image a href=FilingsSearch.aspimg border=0 alt=Clear src=../images/clear_search_top.gif/a a href=javascript:SaveAlertSearch();img border=0 alt=Clear src=../images/save_search_button.gif/a /td /tr I Wanna Click On The image button with url search_top.gif So I Used [i]ie.image(:src, /search_top/i).click[/i] But It Didn't Work Properly As It Always Clicking On The 2nd Occurrence Of search_top, i.e On The Link clear_search_top ... I Don't Know Why... Any Ideas Will Be Helpful... :) Thanks ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How To Click On The Image Button...With This html Code?
Hi, The element you are trying to click is not an image element i.e. not of type image. But its input type=image which is different. So you should try using following code. ie.button(:src, /search_top/i).click If you use your code 'Watir' is correctly clicking the image which is having the source you specified and not clicking image button which you should access using ie.button. - Angrez On 5/4/07, san [EMAIL PROTECTED] wrote: Hi People.. Heres The Code: tr td height=15/td/tr tr align=left td align=left colspan=2 valign=bottom input border=0 alt=Search src=../images/search_top.gif name=CTL_SUBMIT type=image a href=FilingsSearch.aspimg border=0 alt=Clear src=../images/clear_search_top.gif/a a href=javascript:SaveAlertSearch();img border=0 alt=Clear src=../images/save_search_button.gif/a /td /tr I Wanna Click On The image button with url search_top.gif So I Used [i]ie.image(:src, /search_top/i).click[/i] But It Didn't Work Properly As It Always Clicking On The 2nd Occurrence Of search_top, i.e On The Link clear_search_top ... I Don't Know Why... Any Ideas Will Be Helpful... :) Thanks ___ 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
[Wtr-general] How To Add A Cookie Earned From Watir To Mechanize...
Hi People... I Need To Add A Cookie From A Site That I Accessed Through Watir To A WWW::Mechanize Agent... Is There Any Way To Do It, Or Will It Be Possible To Be Really Authenticated In The Site Then By Mechanize Agent.. e.g If I Say If I Login In Yahoo By Watir And Then Try To Access My Inbox By A New Mechanize Agent Will It Do? ie=IE.new ie.goto('') ie # Logged In cookie = ie.document.cookie agent = WWW::Mechanize.new page = agent.get('') # here I Want To Go To My Inbox But I Have Authentication Problem 401 error I Hope If I Can Transfer Cookie To Mechanize It Will Authenticate Me... Any Suggestions... Thanks... ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] How To Click On The Image Button...With This html
Hi Angrez, Thanks.. That Worked... Don't Know How Did I Missed That Out :P Thanks... :) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] can you help why ODBC connection failure worked one time and not working no
What's the warning message? On 5/4/07, Venkata [EMAIL PROTECTED] wrote: Thanks chareley, i keep getting warning message in the log end of te script execution. Thanks. ___ 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] Watir + Autoit + Save As
Thank's, Yes i already do that, and the control take the focus, but it don't want to click on it ... :-( Any suggestion ?? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] FireWatir doesn't ignore if it doesn't exists but Watir does
Hi Folks, I have scripts that use authentication. So when I start my first test, it goes to a login page and once I click the login button, my test runs. Subsequent tests runs without going to the login page as I'm now authorished to run the rest of the scripts. So in my code if the login button appears, I click it. If it doesn't appear due to me being already logged in, it justs prints a message and runs the rest of the script. Watir doesn't this fine i.e. clicks the login button if there, otherwise ignores it However FireWatir doesn't ignore the login button and bombs out when it sees it. code if browser.contains_text(Login Page) browser.button(:name, LoginButton).click puts Action: clicked the Login button. else puts Action: the login page didn't appear end /code ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Setting focus in a frame in IE7
Assuming your html uses regular type html input type - text name='foo' maxLength=3 and you only want to test that the text field only allows 3 chars, why not use ie.text_field(:index,1).maxLength I guess if the maximum length is imposed by a javascript method on the onKeyPress event, then this wouldnt work. As to why your code no longer works, I have no clue ;-) - Original Message - From: Trevor Mason [EMAIL PROTECTED] To: wtr-general@rubyforge.org Sent: Friday, May 04, 2007 9:48 AM Subject: [Wtr-general] Setting focus in a frame in IE7 I have a test that used to work on IE6(WIN2k), but does not with IE7(WINXP) I am using send_keys to send 4 chars to a text field that has a maximum length of 3, then checking there are only 3 chars In IE7, the focus does not move from the IE address bar, and I get placed here. If I use IRB and manually click somewhere within the frame before running these commands, it works! $ie.frame(mainFrame).frame(centralFrame).text_field(:name, 'privateDataDescriptor').focus $ie.send_keys() Does anyone have any ideas? Trevor ___ 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] Setting focus in a frame in IE7
I just ran the same code with IE7 and it appeared to work fine. Just out of curiosity why use send_keys instead of setting the text field? ie.text_field(:index, 1).set('foo') -Charley On 5/4/07, Paul Rogers [EMAIL PROTECTED] wrote: Assuming your html uses regular type html input type - text name='foo' maxLength=3 and you only want to test that the text field only allows 3 chars, why not use ie.text_field(:index,1).maxLength I guess if the maximum length is imposed by a javascript method on the onKeyPress event, then this wouldnt work. As to why your code no longer works, I have no clue ;-) - Original Message - From: Trevor Mason [EMAIL PROTECTED] To: wtr-general@rubyforge.org Sent: Friday, May 04, 2007 9:48 AM Subject: [Wtr-general] Setting focus in a frame in IE7 I have a test that used to work on IE6(WIN2k), but does not with IE7(WINXP) I am using send_keys to send 4 chars to a text field that has a maximum length of 3, then checking there are only 3 chars In IE7, the focus does not move from the IE address bar, and I get placed here. If I use IRB and manually click somewhere within the frame before running these commands, it works! $ie.frame(mainFrame).frame(centralFrame).text_field(:name, 'privateDataDescriptor').focus $ie.send_keys() Does anyone have any ideas? Trevor ___ 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 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] how to include external script (.rb) in Watir?
Hi guys, I apologize if this thread had been discussed before. I was looking for it, but I couldnt find it. here is what I'm trying to do. I define a bunch of classes and functions in a.rb file, and I'm going to write the main script which hopefully can interact/use all the functions and classes in .rb scripts. Let's say all the functions and classes are defined in extra.rb and my main driver script is main.rb. My question is what the script is to include/require extra.rb file in my main.rb. The reason is in main.rb, I want to have something simple like, # the header require 'watir' # the watir controller require 'win32ole' # excel sheet ?? require 'extra.rb' or open 'extra.rb' or what?? ... # the script DoEverything1() # function defined in extra.rb DoEverything2() # function defined in extra.rb ... # end of script any help or hint will be much appreciate. thank you. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to include external script (.rb) in Watir?
Hi, Put require 'extra' near the top of main.rb. For now keep them both (extra.rb and main.rb) located in the same folder. Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] FireWatir not finding buttons by id
Im going to guess that this is a bug in 1.5 Seems like this would be an opportunity to sync up FireWatir with Watir. I think Charley has been looking into some of that recently. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to include external script (.rb) in Watir?
thanks for the quick respond. that was easy, huh.. I just thought too much on that one. beginner...:( ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to include external script (.rb) in Watir?
On 5/4/07, Alien Ruby [EMAIL PROTECTED] wrote: thanks for the quick respond. You are welcome. :) that was easy, huh.. It is Ruby, (almost) everything is easy here. I just thought too much on that one. beginner...:( It happens. That is why this mailing list exists. Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] FireWatir not finding buttons by id
It's a curious bug, just saw the same thing. A bug/feature, works more than it should. :) Chris is right we should definitely spend more time with Angrez, Prema and the Firewatir community. I'm getting slammed by requests for multiple browser tests and starting to abstract layers so that it's easier. -c On 5/4/07, Chris McMahon [EMAIL PROTECTED] wrote: Im going to guess that this is a bug in 1.5 Seems like this would be an opportunity to sync up FireWatir with Watir. I think Charley has been looking into some of that recently. ___ 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
[Wtr-general] Using an ie.table.each do |row| loop when the page in the ie window refreshes itself
Here's the code snippet that's giving me problems: ie.table(:index,29).each do |row| if (row[1].text =~ /#{journals}/) != nil then #If there is a match for that regex row[5].link(:index,1).click # this makes the popup window appear cw = Watir::IE.attach(:title,'Popup Window') # attach to the popup window doRolesPopup(cw) # fill out and submit the form end end doRolesPopup fills out a form in the cw page, then clicks submit. The submit button submits the form, then closes the cw window and reloads the ie window. This reload of the page referenced by the ie object appears to break the row object, since I get the following error: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `invoke': unknown property or method `rows' (WIN32OLERuntimeError) HRESULT error code:0x80070005 Access is denied. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2461:in `row' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `upto' from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:2404:in `each' from assignroles.rb:51 from c:/ruby/lib/ruby/1.8/csv.rb:532:in `parse' from c:/ruby/lib/ruby/1.8/csv.rb:560:in `each' from c:/ruby/lib/ruby/1.8/csv.rb:531:in `parse' from assignroles.rb:35 Is there any way to keep this simple .each loop, or do I need to work around it? Thanks, Ian ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to include external script (.rb) in Watir?
How are you guys so helpful ? It just makes me want to keep coding all weekend. need lots of coffee then... have a great weekend, guys..!! ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] how to include external script (.rb) in Watir?
On 5/4/07, Alien Ruby [EMAIL PROTECTED] wrote: How are you guys so helpful ? That's actually a really good question. The people who started Watir had all participated in other Open Source projects, some successful, some unsuccessful. The early Watir community insisted that everyone, particularly beginners, be treated with respect and courtesy. Many, if not most, of the Watir community are not expert programmers. If the project is going to continue, and continue to be successful, two things have to happen: beginners must continue to be treated with respect and courtesy; and as people get more experience with Watir and Ruby, they have to be encouraged in turn to help out where they can contribute. Mostly this means answering questions on the list: if you see a question you can answer, please do so. It's OK if you're wrong-- as long as you are not deliberately misleading, we will all learn something. In addition, if you can help with documentation or patches or features, please contribute that work also. Charley just asked today for contributions to the user guide. Maybe a reference to the copy of Pickaxe included with the Ruby distro would be a good thing. One very exciting project happening sort of under the radar is to make Watir, FireWatir, SafariWatir, (and possibly Selenium RC) all have a more consistent set of functionality and syntax. I'm not a great programmer, but I like to answer off-topic questions on the list, and I've started to use the non-IE Watirs, and I contributed my first inconsistency report yesterday. The point being, that a few little contributions here and there move the project along nicely, as long as a large number of people are making the contributions. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Community involvement with Watir
Charley Baker wrote: I'd like to send out another annoucement asking for people to contribute to the Watir user guide and volunteer. I've started poking around at the user guide today and made a few changes, notably to update view source with the ie developer toolbar. I'll make further changes if as I get time, but am making the call for volunteers to add information and help out, much of which is related to Watir 1.5. Let me know if you're interested in helping out. I think i convinced Zeljko today to take the lead in updating the users guide. Zeljko, how can we all help you? Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] FireWatir doesn't ignore if it doesn't exists but Watir does
Eoin wrote: However FireWatir doesn't ignore the login button and bombs out when it sees it. It would help if you showed us the error and the page. However, my guess is that the problem is with the behavior of contains_text. In Watir for IE 1.4 this did not include the title. In Watir for 1.5 it does look in the title. I think Firewatir is working like Watir for IE 1.4. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] The Plan for Watir
I've been doing a lot of thinking and planning for what we need to do with Watir. I've also been fairly quiet. I now have a new job and have been preoccupied by the change in jobs lately: with wrapping up affairs at my old job at DataCert, with a job search, and then with starting at Dovetail, where they had built up a bit of a backlog of work for me which I've finally dug out from. Dovetail has made a big commitment to Watir: to using it to test our software, to supporting enhancements that we will be using, and even to giving me time to attend to the necessary affairs in running an open-source project. In fact, Dovetail intends to ship our testing framework and our tests themselves to our customers. This means that our tests will need to be good: be easy to understand, extend, run and interpret. I am very excited by the opportunity. Watir 1.5 is getting very close to being done. As soon as it looks like we've fixed all the serious compatability bugs with Watir 1.4, we will be posting the 1.5 gem to Rubyforge. This means that it will become the default gem that will be installed when you do a gem install watir. Originally I wanted to wait until we got the documentation for 1.5 updated, but now now i think that can wait for a later point release (say 1.5.3). Charley tells me that many of the questions on the wtr-general list regard problems that would be solved by moving to 1.5, so it really will help to move there. By the way, Charley has also been rather busy lately, partly because people keep hiring his Watir testers away from him. So if you are one of these people, stop it. It only hurts Watir, in the end, by forcing him to spend all his time on his day job. Jeff Fry is threatening to help out with the Rdoc and Zeljko has agreed to take the lead with updating the users guide. Please cooperate with any requests that they make. Many of you have noticed that FireWatir is looking very good. SafariWatir is also looking good. The number one goal that I have for Watir is pull together these different forks of Watir. In my view they should all be part of one library, or perhaps each will be a plug in to a standard library, much as, say the Ruby DBI library supports plug ins for each of the different types of databases. In our case, we'd have separate plug ins for each browser. This means supporting multiple browsers and making Watir work on multiple platforms. The importance and complexity of this goal is part of what is urging me to wrap up Watir 1.5. We are targeting Watir 2.0 to include plugins for each of the main browsers. I also plan to continue working on a Selenium plugin to Watir. This would allow existing Watir tests to run tests using any browser when connecting to a Selenium-enabled server. This, like all the browsers, will be optional; so if Selenium scares you, you will be able to continue to use Watir the old-fashioned way. In preparation for this, Watir 1.6 will begin the restructuring of the existing code base to support plugins and remove the code duplication that currently exists in the different forks. This will require reorganizing the code files, and therefore we will want to merge all patches before this reorg starts. We will also be taking this occassion to make many changes to Watir that we've been considering for some time, but have put off because of concerns about backwards compatibility. We have attempted to make upgrading from 1.4 to 1.5 extremely easy. Upgrading to 1.6 will be more difficult. In particular, we will be converting Watir to use zero-based indexing in 1.6. Another key element to getting Watir 1.5 out is updating our website. We will be publishing a new, detailed, multi-page website aimed at our general user community. This website will be hosted at wtr.rubyforge.org and will include current information about the various releases and how to install them and where the mailing lists are. And we'll be keeping it up to date, as we move forward with this plan. We will continue to use the wiki at OpenQA for the active user community and there will be several links from the general website into the wiki. We have had a lot trouble keeping the various pages on the OpenQA website updated and accurate and will be replacing them with pointers either to the website or to the wiki. I realize that the current arrangement is very confusing and appreciate your patience. The Jira roadmap more or less lays out the next few steps in our plan. We will be updating it shortly to better match up to the plan I lay out here. If you have bugs you want fixed or features you want added, please make sure there is an open Jira ticket for them. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] The Plan for Watir
Good information. You and Charley and maybe some others should put this in blogs so the wider world can find it. On 5/4/07, Bret Pettichord [EMAIL PROTECTED] wrote: I've been doing a lot of thinking and planning for what we need to do with Watir. I've also been fairly quiet. I now have a new job and have been preoccupied by the change in jobs lately: with wrapping up affairs at my old job at DataCert, with a job search, and then with starting at Dovetail, where they had built up a bit of a backlog of work for me which I've finally dug out from. Dovetail has made a big commitment to Watir: to using it to test our software, to supporting enhancements that we will be using, and even to giving me time to attend to the necessary affairs in running an open-source project. In fact, Dovetail intends to ship our testing framework and our tests themselves to our customers. This means that our tests will need to be good: be easy to understand, extend, run and interpret. I am very excited by the opportunity. Watir 1.5 is getting very close to being done. As soon as it looks like we've fixed all the serious compatability bugs with Watir 1.4, we will be posting the 1.5 gem to Rubyforge. This means that it will become the default gem that will be installed when you do a gem install watir. Originally I wanted to wait until we got the documentation for 1.5 updated, but now now i think that can wait for a later point release (say 1.5.3). Charley tells me that many of the questions on the wtr-general list regard problems that would be solved by moving to 1.5, so it really will help to move there. By the way, Charley has also been rather busy lately, partly because people keep hiring his Watir testers away from him. So if you are one of these people, stop it. It only hurts Watir, in the end, by forcing him to spend all his time on his day job. Jeff Fry is threatening to help out with the Rdoc and Zeljko has agreed to take the lead with updating the users guide. Please cooperate with any requests that they make. Many of you have noticed that FireWatir is looking very good. SafariWatir is also looking good. The number one goal that I have for Watir is pull together these different forks of Watir. In my view they should all be part of one library, or perhaps each will be a plug in to a standard library, much as, say the Ruby DBI library supports plug ins for each of the different types of databases. In our case, we'd have separate plug ins for each browser. This means supporting multiple browsers and making Watir work on multiple platforms. The importance and complexity of this goal is part of what is urging me to wrap up Watir 1.5. We are targeting Watir 2.0 to include plugins for each of the main browsers. I also plan to continue working on a Selenium plugin to Watir. This would allow existing Watir tests to run tests using any browser when connecting to a Selenium-enabled server. This, like all the browsers, will be optional; so if Selenium scares you, you will be able to continue to use Watir the old-fashioned way. In preparation for this, Watir 1.6 will begin the restructuring of the existing code base to support plugins and remove the code duplication that currently exists in the different forks. This will require reorganizing the code files, and therefore we will want to merge all patches before this reorg starts. We will also be taking this occassion to make many changes to Watir that we've been considering for some time, but have put off because of concerns about backwards compatibility. We have attempted to make upgrading from 1.4 to 1.5 extremely easy. Upgrading to 1.6 will be more difficult. In particular, we will be converting Watir to use zero-based indexing in 1.6. Another key element to getting Watir 1.5 out is updating our website. We will be publishing a new, detailed, multi-page website aimed at our general user community. This website will be hosted at wtr.rubyforge.org and will include current information about the various releases and how to install them and where the mailing lists are. And we'll be keeping it up to date, as we move forward with this plan. We will continue to use the wiki at OpenQA for the active user community and there will be several links from the general website into the wiki. We have had a lot trouble keeping the various pages on the OpenQA website updated and accurate and will be replacing them with pointers either to the website or to the wiki. I realize that the current arrangement is very confusing and appreciate your patience. The Jira roadmap more or less lays out the next few steps in our plan. We will be updating it shortly to better match up to the plan I lay out here. If you have bugs you want fixed or features you want added, please make sure there is an open Jira ticket for them. Bret ___ Wtr-general mailing list Wtr-general@rubyforge.org