亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Some selenium tips關于Selenium的小竅門
作者:網絡轉載 發布時間:[ 2013/4/7 15:55:26 ] 推薦標簽:

  定義后,我能這樣寫代碼

  def submit_order

  s('button#submit').click

  end

  The short method name "s" is inspired by jQuery. Here it will keep polling the DOM for 10 seconds until it finds the button with id "submit". It's like implicit wait but only for finding one element. When you really need to wait for multiple elements, you can use an explicit wait, which, to me, makes more sense than a hidden implicit one.

  短方法 s 的靈感是來源于jQuery。 它會輪詢DOM 10秒,直到它在找到一個id 為'submit'的button 為止。當只找一個元素時,用隱式等待是恰當的,當你真的需要定位多個對象的時候,你應該使用顯示等待,對我來說,這樣有意義。

  譯者注:關于顯式等待和隱式等待的區別,請看下面討論及文檔,有助于理解我在翻譯什么... : (

  http://groups.google.com/group/selenium-users/browse_thread/thread/fd0cb59b953f5e94/123380cef05d7bdb?lnk=raot

  http://seleniumhq.org/docs/04_webdriver_advanced.html

  Set the initial browser window size when using Chromedriver.

  當在使用Chromedirver時,設定瀏覽器窗口初始化大小

  Ruby code:

  profile = Selenium::WebDriver::Chrome::Profile.new

  profile['browser.window_placement.top'] = 0

  profile['browser.window_placement.left'] = 0

  profile['browser.window_placement.right'] = 1024

  profile['browser.window_placement.bottom'] = 768

  driver = Selenium::WebDriver.for :chrome, profile: profile

  This works in both Windows and OSX (will try Linux and update here)

  Bad news for Java, C# and Python coders though, it seems that as of now setting chrome preference is not supported in the java version of Webdrive. Your best chance could be creating a ChromeProfile class based on the exiting FirefoxProfile class.

  以上的代碼在windows 和 OSX 上都工作正常。壞消息是,對于Java , C# 和Python 的coder 來說,看上去現在Java版本的webdriver還不支持設定chrome 的屬性。 你好是基于現有的FirefoxProfile 類來創建一個ChromeProfile 類。

  Scroll to a button before clicking it.

  滾動到相應的button后才點擊

  Clicking buttons sometimes randomly fail. It could be caused by the fact that the button is out of the view area at the moment you command selenium to click it. One way to address it is to always scroll to it before clicking it.

  點擊button有時候會無故失敗,這可能是由于selenium 執行點擊命令的時候,這個button在視圖之外。所以解決這個問題的其中一個方法是,滾動到相應的button后才點擊。

上一頁12下一頁
軟件測試工具 | 聯系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網站地圖
滬ICP備07036474 2003-2017 版權所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 成人精品视频在线观看播放 | 自偷自偷自亚洲首页精品 | 亚洲综合精品一二三区在线 | 精选国产门事件福利在线观看 | 国产精品激情丝袜美女 | 视频黄色免费 | 一级毛片完整免费版 | 天天碰天天射 | 巨胸喷奶水www久久久 | 国产精品午夜在线观看 | 日韩精品卡1卡二卡3卡四卡 | 福利免费看 | 日本ccc三级| 日本理论午夜中文字幕第一页 | 免费看欧美日韩一区二区三区 | 又黄又变态又免费的视频 | 中文字幕av一区二区三区 | 5252色| 欧美国产日本精品一区二区三区 | 黄色毛片视频网站 | 在线免费视频一区 | 日韩欧美高清在线观看 | 人人爱天天做夜夜爽 | 欧美一级裸片 | 亚洲 欧美 中文字幕 | 亚欧美图片自偷自拍另类 | 成人片在线播放 | 草草影院最新 | 精品国产一区二区三区在线 | 成人免费福利网站在线看 | 蜜桃视频成a人v在线 | 成年视频在线观看 | 日日操干 | 在线免费观看日韩视频 | 在线国产日韩 | www.亚洲精品 | 大色综合色综合网站 | 一级一级一级毛片 | 欧美精品videossex变态 | 成人免费专区 | 老湿影院在线免费观看 |