1

Perhaps I have to manage with bad HTML programming (check here).

In below code <i> doesnt represent a word in italics but an icon. Which I want to click but which WATIR is suitable for this?

I went to this post and I tried button and image methods but none worked.

I tried it by creating its page object (as it is the way I want it to be).

button(:attendees_list, :title => 'attendees') and image(:attendees_list, :title => 'attendees')

used it as on(UpcomingWebinarPage).attendees_list

<a class="webinar" href="javascript:;">
  <i class="icon" title="attendees"></i>
  <span class="number">12</span>
</a>
Community
  • 1
  • 1
paul
  • 4,333
  • 16
  • 71
  • 144

2 Answers2

0

I think, you can try to use element :

b.element(:title, 'attendees').click
Oleksandr Holubenko
  • 4,310
  • 2
  • 14
  • 28
0

In page-object, you'd want to create a generic element. Because this is a strange case, I would use XPath to identify it.

element(:attendees_list, :i, xpath: "//i[@title='attendees']")

And click it with:

page.attendees_list_element.click
Johnson
  • 1,510
  • 8
  • 15