Re: [Wtr-general] eba:Combo
FYI combo = ie.ie.document.getElementById(id).object combo.SetTextValue(value) - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3510messageID=9955#9955 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] ruby_testing_techniques
Hi, The London Ruby User Group have hoisted up a site of Ruby presentations. Two that may be of interest to us are: 1) ruby_testing_techniques 2) ruby_dsl_presentation_tiest_2006 http://svn.lrug.org/lrug_sandbox/presentations/ aidy --- This message and any attachment are confidential and may be privileged or otherwise protected from disclosure. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person. --- ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Regex string comparison
Hi there, I'm still a novice when it comes to using regular expressions and am having a bit of difficulty figuring out the syntax on the following problem.Here's what I want to do:- I'm trying to create a branch in the code if the PageHeadingLabel contains one of two words. Here's the line that I've tried: if t_ie.span(:id, /PageHeadingLabel/).text.include?( /Create|Update/ )This doesn't work. When I try it in IRB, I see the following message:---TypeError: can't convert Regexp into String from (irb):7:in `include?' from (irb):7 from :0---Suggestions? I really didn't want to use two comparisons, one for each word. There must be an efficient way to do this, yes? Paul. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regex string comparison
Sweet! Worked like a charm. Thanks. Learned something new today. I guess I can go home now. ;-)Cheers! Paul.On 15/08/06, Dave Hoover [EMAIL PROTECTED] wrote:Yep, use the String#match method. http://www.ruby-doc.org/core/classes/String.html#M000583 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Regex string comparison
Paul Carvalho wrote: if t_ie.span(:id, /PageHeadingLabel/).text.include?( /Create|Update/ ) the include? method is for strings, not regular expressions. Try: if t_ie.span(:id, /PageHeadingLabel/).text.match( /Create|Update/ ) or if t_ie.span(:id, /PageHeadingLabel/).text =~ ( /Create|Update/ ) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Using regular expressions in Watir
Hi all, I am new to Watir and Ruby. I saw the document (which is really good, btw) and it talk about one scenario of using regular expressions like below. ie.link(:url, /shtml/).click This one, I believe, will look for the term in a string. What I need do to only look for the string which ends with the given section. For example, I have two form fields with id like FormName_Name1 and FormName_Name1New So when I use the Watir statement like e.text_field(:id,/_Name1/).set(astharaj) it will put the same in both right? I want it to just set for first field (FormName_Name1). How can I do this? Any suggestions would be great. Also, if there is a label of the same name and I am using text_field in the watir statement then it will not look at the label right? Thanks, Astha ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Using regular expressions in Watir
On 8/15/06, Astha Raj [EMAIL PROTECTED] wrote: What I need do to only look for the string which ends with the given section. For example, I have two form fields with id like FormName_Name1 and FormName_Name1New So when I use the Watir statement like – e.text_field(:id,/_Name1/).set(astharaj) – it will put the same in both – right? I want it to just set for first field (FormName_Name1). How can I do this? Any suggestions would be great. Use the \A and \Z anchors to match the beginning and end of strings, respectively. I believe the answer to your question is e.text_field(:id, /_Name1\Z/).set(astharaj) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Using regular expressions in Watir
Dave Hoover wrote: On 8/15/06, Astha Raj [EMAIL PROTECTED] wrote: What I need do to only look for the string which ends with the given section. For example, I have two form fields with id like FormName_Name1 and FormName_Name1New So when I use the Watir statement like – e.text_field(:id,/_Name1/).set(astharaj) – it will put the same in both – right? I want it to just set for first field (FormName_Name1). How can I do this? Any suggestions would be great. Use the \A and \Z anchors to match the beginning and end of strings, respectively. I believe the answer to your question is e.text_field(:id, /_Name1\Z/).set(astharaj) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general actually, the easier way is: e.text_field( :id, /_Name1$/.set( ashtharaj ) $ is the regex standard way of denoting END of line. ^ is the regex standard way of denoting BEGINNING of line. I've never seen \A \Z before. I would try to use standard regex things ... that way you aren't stuck when you eventually grow into using other programming languages which don't support that non-standard extension. ... just my $0.02 jd ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Setting Textbox throws unknown method 'scrollIntoView' error
I am running watir 1.5.1.1065 I am simply calling set on a text_field, and I get this error: WIN32OLERuntimeError: Unknown property or method `scrollIntoView' HRESULT error code:0x80010004 The caller is dispatching an asynchronous call and cannot make an outgoing call on behalf of this call. C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1065/./watir.rb:3829:in `method_missing' C:/ruby/lib/ruby/gems/1.8/gems/watir-1.5.1.1065/./watir.rb:3829:in `set' Any idea? Thanks much, -James - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3607messageID=10002#10002 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Setting Textbox throws unknown method 'scrollIntoView' error
im calling ie.text_field(:name, /name/i).set(blah) HTML of textfields is: tr valign=middle td width=85User Name/td td width=100input name=ctl00$ContentPlaceHolderContentMain$UserName type=text id=ctl00_ContentPlaceHolderContentMain_UserName //td td span id=ctl00_ContentPlaceHolderContentMain_UserNameValidator class=errorStyle style=color:Red;visibility:hidden; Required! /spannbsp; /td /tr tr valign=middle tdPassword/td td input name=ctl00$ContentPlaceHolderContentMain$Password type=Password id=ctl00_ContentPlaceHolderContentMain_Password //td td valign=middle span id=ctl00_ContentPlaceHolderContentMain_PasswordValidator class=errorStyle style=color:Red;visibility:hidden; Required! /spannbsp; /td /tr -James - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3607messageID=10004#10004 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Setting Textbox throws unknown method 'scrollIntoView' error
note, getting the textfield by id, without a regex. works fine. -Mase (james) - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3607messageID=10005#10005 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Setting Textbox throws unknown method 'scrollIntoView' error
This appears to be a larger problem. Any element that is found with a regular expression passed as the value. Seems subsequent messages to that object results in the above error. IE crashes as well. -Mase - Posted via Jive Forums http://forums.openqa.org/thread.jspa?threadID=3607messageID=10007#10007 ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general