Re: [Wtr-general] Unable to locate object using ie.#{variable}
Hi Jason, Try: v_type = 'text_field' instance_eval("ie.#{v_type}(:id, 'emailAddress').flash") Or: v_type = 'text_field' ie.send(v_type.to_sym, :id, 'emailAddress').flash ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object using ie.#{variable}
> > v_type = text_field > > ie.#{v_type}(:id, "emailAddress").flash > I think you can not do that. What do you want to do with that? Maybe there > is another way. I simply wanted to loop through a list of objects (text_fields, select boxes, radio buttons, checkboxes, etc) on a page, ensuring each exists and maybe a little more verification for each (value, colour, maxlength, etc...). However, I'm attempting to drive a lot of my tests via data-sets, i.e. .CSV files, rather than hardcoding too many field details into the script itself. Suggestions? It's actually not a big deal, I'll just script each field I think. Just attempted the above, hoping it might be possible. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object using ie.#{variable}
On 6/28/07, Jason <[EMAIL PROTECTED]> wrote: Can I actually do this??? Hi Jasnon, I think you can not do that. What do you want to do with that? Maybe there is another way. Zeljko -- ZeljkoFilipin.com ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object using ie.#{variable}
Should this be possible? i.e. rather than specify an *exact* object within the IE, have this 'object' within a variable: v_type = text_field ie.#{v_type}(:id, "emailAddress").flash It doesn't work as I have it above. Neither do the following: ie.{v_type}(:id, "emailAddress").flash ie.#v_type(:id, "emailAddress").flash ie.v_type(:id, "emailAddress").flash Can I actually do this??? ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object using :url => /{variable}/
I've definitely tried it with and without the slashes "//". I also tried these slashes within the variable itself, and even tried escaping the slashes with "\", with no luck. I'll be certain to try the "{}" and "#" on Monday - hopefully will do the trick. ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object using :url => /{variable}/
If testing_URL is a variable, I guess, it should be used without the slashes "//". Or, this also may work: $ie.link(:url => /#{testing_URL}/, :text => /More.../).click ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
[Wtr-general] Unable to locate object using :url => /{variable}/
Really quick one... Trying to identify and click a link on a page, using the following: $ie.link(:url => /testing_URL/, :text => /More.../).click Where "testing_URL" is a variable I'm passing the script in a loop. In the first instance, the variable value is *search-requests*. The actual links in the code look something like: https://{+domain+}/search-requests/";>More... I'm receiving the following error: "Unable to locate object, using text(?-mix:More...)urlsearch-24hours and" It's probably quite simple, I suspect my understanding of the "/" characters and use of the variable is making life difficult for myself. Any quick assistance? (Sorry, google searching for this proved very difficult, so apologies.) ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] 'Unable to locate object' problem
Hi, Please edit responses to refer to the original header and not the digest header. I missed the fact that the src attribute is pointing to textarea, it's not a text control. Try using IE developer toolbar to find the control and some sort of identifiable attribute - name, id, index. Then use that to set it in Watir. http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038 -Charley On 5/3/07, Imran Hussain <[EMAIL PROTECTED]> wrote: Hi Charley, Thanks for the info but it still doesn't work, I now get the following error: c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:3388:in `method_missing': focus (WIN32OL ERuntimeError) OLE error code:800A083E in htmlfile Can't move focus to the control because it is invisible, not enabled, or o f a type that does not accept the focus. HRESULT error code:0x80020009 Exception occurred. from c:/ruby/lib/ruby/site_ruby/1.8/watir.rb:338 8:in `set' Thanks, Imran ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] 'Unable to locate object' problem
You're trying to write to what appears to be a frame not the textarea. ie.text_field(:name, 'SN_NOTESSText').set('this should work') -Charley On 5/2/07, Imran Hussain <[EMAIL PROTECTED]> wrote: Hi, 'Unable to locate object' problem When running the following show_all_objects command, I get; rb(main):016:0> ie.show_all_objects ---Objects in page - HTML Document name= id=SN_NOTESSFrame src= textarea name=SN_NOTESSText id= value= How do I write to this object? do I use this: ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234") Is this within a frame?? This doesn't seem to be working can someone help? Thanks, Imran ___ 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] 'Unable to locate object' problem
Hi, 'Unable to locate object' problem When running the following show_all_objects command, I get; rb(main):016:0> ie.show_all_objects---Objects in page - HTML Document name= id=SN_NOTESSFrame src=textarea name=SN_NOTESSText id= value= How do I write to this object? do I use this: ie.text_field(:id ,"SN_NOTESSFrame").set("TESTING 1234") Is this within a frame?? This doesn't seem to be working can someone help? Thanks,Imran___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object
Hi Charley, I installed latest gem, the test case ran fine. Then, I restarted IntelliJ, now when run the test, IE browser is not open. It is the same in the irb command line window. Is there something I need to change? Thanks. Kui ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object
Yep, we still include autoit. -c On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote: Hi Charley, Follow your instruction, installed the latest Watir gem. It works now! One question, if I installed the Watir gem, does this include autoit which I need to use in the testing? Or how to check if the autoit is installed with Watir? Thanks so much for your help. Kui ___ 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] Unable to locate object
Hi Charley, Follow your instruction, installed the latest Watir gem. It works now! One question, if I installed the Watir gem, does this include autoit which I need to use in the testing? Or how to check if the autoit is installed with Watir? Thanks so much for your help. Kui ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object
Install the latest gem for Watir 1.5.1 and try it again if you can . Here's a link for how to do just that: http://wiki.openqa.org/display/WTR/Development+Builds Follow the instructions on the right pane To Install. -Charley On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote: Thanks Charley for the quick response! I tried with your suggestion (ie.button(:text, �Login�).click) and still received the same error message. Here is DOM for the login button. I also tried with the ie.form(:name, �mainForm�).button(:text, �Login�).click. Not working. Anything I can try? Really appreciate your help! Kui http://benicia.guidewire.com:10402/cc402/ClaimCenter.do"; method="post"> Login ___ 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] Unable to locate object
Thanks Charley for the quick response! I tried with your suggestion (ie.button(:text, Login).click) and still received the same error message. Here is DOM for the login button. I also tried with the ie.form(:name, mainForm).button(:text, Login).click. Not working. Anything I can try? Really appreciate your help! Kui http://benicia.guidewire.com:10402/cc402/ClaimCenter.do"; method="post"> Login ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general
Re: [Wtr-general] Unable to locate object
smokeid means nothing in standard dom. You can use :text to identify the control. Watir works off of standard html attributes and the DOM, this is some sort of custom attribute. This should work. ie.button(:text, 'Login').click -Charley On 4/30/07, Kui Zhang <[EMAIL PROTECTED]> wrote: Hello, I just started to write a test script below. When run the script, I always received error message: C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to locate object. HTML source is attached. What did I missing here? Should I be able to use smokeId to identify the elements? Please help. Thanks! Kui require 'watir' test_site = 'http://x' ie = Watir::IE.new ie.goto(test_site) sleep(5) ie.text_field(:label, "Username").set("aa") ie.text_field(:text, "Password").set("bb") ie.button(:smokeId, "submit").click Source: Username Password Login ___ 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] Unable to locate object
Hello, I just started to write a test script below. When run the script, I always received error message: C:/ruby/lib/ruby/site_ruby/1.8/watir.rb:1928:in `assert_exists': Unable to locate object. HTML source is attached. What did I missing here? Should I be able to use smokeId to identify the elements? Please help. Thanks! Kui require 'watir' test_site = 'http://x' ie = Watir::IE.new ie.goto(test_site) sleep(5) ie.text_field(:label, "Username").set("aa") ie.text_field(:text, "Password").set("bb") ie.button(:smokeId, "submit").click Source: Username Password Login ___ Wtr-general mailing list Wtr-general@rubyforge.org http://rubyforge.org/mailman/listinfo/wtr-general