hi, <span class="ui-btn-text"> Get Instant Quote </span> Is there anyway Can I write code locate the element using the text " Get Instant Quote "? I can write a code like b.span(:class,'ui-btn-text').click But this :class attribute is common to every other elements, So is there any way to locate the span using the text ' Get Instant Quote '? Any help?
on 2014-08-06 15:13
on 2014-08-07 00:09
Did you try "text"? irb(main):003:0> b.span(text: 'Get Instant Quote') => #<Watir::Span:0x487ee79c located=false selector={:text=>"Get Instant Quote", :tag_name=>"span"}> irb(main):004:0> b.span(text: 'Get Instant Quote').attribute_value('class') => "ui-btn-text"
on 2014-08-07 07:49
hi, This works fine for me, thanks, yesterday I tried using the same way but it hasn't worked, may I might have added some space like " Get Instant Quote ".