what does the element look like?
On Fri, Feb 14, 2014 at 1:27 PM, Cameron <[email protected]> wrote: > Fixed my code a bit, but still getting timeout errors: > > *My updated code getting timeout errors:* > > if @b.url == "http://www.website.com/cart/plans?ProductId=product" >> $monthlydata = >> ["GC311Z-02","GC307Z-02","GC308Z-02","GC309Z-02","GC310A-02"].sample >> assert @b.radio(:data_sku, $monthlydata).when_present.set >> end >> >> $monthlymin = ["GC504Z","GC505Z","GC506Z","GC507Z","GC508Z"].sample >> assert @b.radio(:data_sku, $monthlymin).when_present.set >> >> $monthlytxt = >> ["GC313Z-02","GC314Z-02","GC315Z-02","GC316Z-02","GC320Z-02"].sample >> assert @b.radio(:data_sku, $monthlytxt).when_present.set > > > *Stacktrace:* > > Error: test_goproject(TestShoppingCart) >> Watir::Wait::TimeoutError: timed out after 30 seconds, waiting for >> {:data_sku= >> >"GC309Z-02", :tag_name=>"input", :type=>"radio"} to become present >> >> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.7/lib/watir-webdriver/wa >> it.rb:33:in `until' >> >> C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-webdriver-0.6.7/lib/watir-webdriver/wa >> it.rb:106:in `method_missing' >> C:/Users/User.Name/Downloads/shoppingcart2.rb:95:in `test_goproject' >> 92: >> 93: if @b.url == " >> http://www.website.com/cart/plans?ProductId=product" >> 94: $monthlydata = >> ["GC311Z-02","GC307Z-02","GC308Z- >> 02","GC309Z-02","GC310Z-02"].sZmple >> => 95: assert @b.radio(:data_sku, >> $monthlydZtZ).when_pr >> esent.set >> 96: end >> 97: >> 98: $monthlymin = >> ["GC504Z","GC505Z","GC506Z","GC507Z","GC50 >> 8Z"].sample > > > > > > On Thursday, February 13, 2014 5:05:41 PM UTC-8, Cameron wrote: >> >> Is trying it this way not possible? I added the code to extend the >> ability to allow custom selectors: >> >> module Watir >> class ElementLocator >> alias :old_normalize_selector :normalize_selector >> >> def normalize_selector(how, what) >> case how >> when :data_sku >> [how, what] >> else >> old_normalize_selector(how, what) >> end >> end >> end >> end >> >> >> And here is my code trying to select it from the random array. Even with >> the middle two lines uncommented I still get errors. >> >> $monthlydata = ["GC311Z-02","GC307Z-02","GC308Z-02","GC309Z-02"," >> GC310Z-02"].sample >> #Watir::Wait.until { @b.radio(:data_sku, $monthlydata) } >> #@b.radio(:xpath, "//input[@data_sku='$monthlydata']").exists? >> @b.radio(:xpath, "//input[@data_sku='$monthlydata']").set (line causing >> the error) >> >> >> The error I get is the UnknownObjectException: unable to locate element. >> The line that's throwing up the error is the last one shown. >> > -- > -- > Before posting, please read http://watir.com/support. In short: search > before you ask, be nice. > > [email protected] > http://groups.google.com/group/watir-general > [email protected] > > --- > You received this message because you are subscribed to the Google Groups > "Watir General" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- Before posting, please read http://watir.com/support. In short: search before you ask, be nice. [email protected] http://groups.google.com/group/watir-general [email protected] --- You received this message because you are subscribed to the Google Groups "Watir General" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
