如何在黄瓜测试时点击同名的第二个链接

时间:2013-08-12 14:12:59

标签: ruby-on-rails cucumber

这是我的查看文件.......我想点击..........

<a class="pull-left width_100" style="font-weight:bold; color:black" href="/service/partner/97">Company name 4</a>
你可以查看我的观看代码......

%ul.pull-left.unstyled.width_100
- @servi<div id="search_data_4">
  <div class="data pull-left" style="width:100%;border-top:1px solid black;border-bottom:1px solid black;margin-top:60px;position:relative;">
  <div class="pagination" style="color: black; top: -100px;" outer_windows="0">
    <ul class="pull-left unstyled width_100">
      <li class="pull-left" style="background-color: #F1F1F1;margin-bottom: 10px;margin-left: 6px;padding: 8px;width: 750px;">
         <ul class="unstyled pull-left" style="width:32%">
            <li class="pull-left width_100">
               <a class="pull-left width_100" style="font-weight:bold; color:black" href="/service/partner/97">Company name 4</a>
               <span class="pull-left width_100">Street No. 4</span>
               <span class="pull-left width_100">zip code 4, city 4, Antigua and Barbuda</span>

我写了步骤定义

When /^I press on any service partner$/ do
  page.driver.browser.execute_script %Q{ $('#search_data_4 ul li ul:eq(0) li a').trigger("mouseenter").click(); }
end

但是此步骤不会运行,因为我想点击该链接。让我知道

0 个答案:

没有答案