【问题标题】:click_no_wait and then execute_scriptclick_no_wait 然后 execute_script
【发布时间】:2016-05-04 16:44:30
【问题描述】:

我正在将页面对象 gem 与包含链接的页面一起使用。

单击链接时,浏览器会导航到新页面,HTML 会按预期呈现。

但是,我的脚本总是返回 Timeout::Error: Timeout::Error。在查看浏览器网络活动后,我注意到一个运行时间很长但永远不会完成的模式。

如果我运行脚本然后转到控制台并发出命令 $.connection.hub.stop(),脚本不会超时。

有没有办法执行click_no_wait 或单击然后通过使用 page_object_gem 执行脚本?

这是我的页面对象尝试,但它仍然导致超时。

class MyThing

   include  PageObject
   include  PageObject::PageFactory

   link(:show_details, :id => 'detailLink')

   def click_show_details_no_wait
     begin
        show_details_element.click
     rescue Exception => e
       execute_script('$.connection.hub.stop();')
     end
   end 

end

【问题讨论】:

    标签: watir-webdriver page-object-gem


    【解决方案1】:

    没有您的页面很难提出建议。我的第一个想法是尝试做

     show_details_element.fire_event('click')
    

    而不是通常的点击。

    第二个想法是看看

    祝你好运。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-10-02
      • 2021-09-09
      相关资源
      最近更新 更多