Hi,

Accessing the spans within minimum_spend_threshold_error would be similar 
to what you did with nav_div_elements:

page.minimum_spend_threshold_error_element.span_elements[0].html
#=> "<span class=\"icon icon-cross-standard-small-black\"></span>"

page.minimum_spend_threshold_error_element.span_elements[1].html
#=> "<span>Sorry, your Perks Payday Voucher will be removed if you proceed 
to checkout</span>"

You could also define them in the page object to make the usage easier:

class MyPage
  include PageObject

  div(:minimum_spend_threshold_error, :class => 'perk-validation-error')
  div(:first_span) { minimum_spend_threshold_error_element.span_elements[0] 
}
  div(:second_span) { minimum_spend_threshold_error_element.span_elements[1] 
}
end

page.first_span_element.html
#=> "<span class=\"icon icon-cross-standard-small-black\"></span>"

page.second_span_element.html
#=> "<span>Sorry, your Perks Payday Voucher will be removed if you proceed 
to checkout</span>"

Hope that helps,
Justin


On Tuesday, July 10, 2018 at 2:54:01 AM UTC-4, NaviHan wrote:
>
> Hi Titus
>
> I have got a related query
>
> I have a section of page
> <div class="perk-validation-error">
>     <div class="close-button close-button-icon">
>         <span class="icon icon-cross-standard-small-black"></span>
>     </div>
>     <div class="error-msg small-text-center">
>         <span>Sorry, your Perks Payday Voucher will be removed if you 
> proceed to checkout</span>
>         <p>This reward is only available on orders AUD 10.00 and over.</p>
>     </div>
> </div>
>
> If I define the outer div as div (:minimum_spend_threshold_error, :class 
> => 'perk-validation-error'), how do I access the first span and second span?
>
> Thanks in advance
>
>

-- 
-- 
Before posting, please read 
https://github.com/watir/watir_meta/wiki/Guidelines-for-Posting-to-Watir-General-Google-Group.
 
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/d/optout.

Reply via email to