簡體   English   中英

使用Ruby在Selenium WebDriver中設置setSpeed

[英]setSpeed in Selenium WebDriver using Ruby

有沒有辦法在ruby中設置Selenium Webdriver的執行速度。

在perl for selenium 1(RC)中有$sel->set_speed("500");

但是由於Selenium RC的一些限制,我不得不轉向Selenium Webdriver並且不得不開始使用Ruby,我找不到相同的功能。

在某處讀取選項“Slow”,“Medium”和“Fast”作為在C#和Perl中設置速度的參數,但不在Ruby中。

注意 - 我確實使用此@driver.manage.timeouts.implicit_wait = 30設置了超時,但我正在尋找執行速度。

一段時間以前,所有語言綁定都不推薦使用WebDriver中設置執行速度的方法。 無法再修改正在運行的WebDriver代碼的執行速度。

根據http://selenium.googlecode.com/svn/tags/selenium-2.10.0/rb/lib/selenium/client/idiomatic.rb中有2種方法Selenium.Client.Idiomatic模塊:

  # Get execution delay in milliseconds, i.e. a pause delay following 
  # each selenium operation. By default, there is no such delay 
  # (value is 0).
  def execution_delay
    string_command "getSpeed"
  end

  # Set the execution delay in milliseconds, i.e. a pause delay following
  # each selenium operation. By default, there is no such delay.
  #
  # Setting an execution can be useful to troubleshoot or capture videos
  def execution_delay=(delay_in_milliseconds)
    remote_control_command "setSpeed", [delay_in_milliseconds]
  end

我想這會有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM