Reputation: 518
Hi I am new to Capybara and selenium.I am using gem 'capybara' and gem 'selenium-webdriver'
.I have a view where I have to click on an icon.The html of the view is
<svg class="assign-job icon icon-box-outgoing" ng-click="something">
<use xlink:href="#icon-box-outgoing"></use>
</svg>
I want to perform click event onto this element.I have also tried using xpath but that didn't work.I have attached a screenshot please find that.
Upvotes: 1
Views: 1974
Reputation: 1
You can use xpath to identify the element.
//div[@class='jobActionsDisplayDeterminer']/*[name()='svg']/*[name()='use'][@xlink:href='#icon-box-outgoing']
Upvotes: 0
Reputation: 42528
You can use a CSS selector to click on the svg
element:
find(:css, "svg.assign-job.icon-box-outgoing").click
or to click on the use
element:
find(:css, "use[href='#icon-box-outgoing']").click
Upvotes: 4