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

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
Some selenium tips關(guān)于Selenium的小竅門
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時(shí)間:[ 2013/4/7 15:55:26 ] 推薦標(biāo)簽:

  定義后,我能這樣寫代碼

  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。 它會(huì)輪詢DOM 10秒,直到它在找到一個(gè)id 為'submit'的button 為止。當(dāng)只找一個(gè)元素時(shí),用隱式等待是恰當(dāng)?shù)模?dāng)你真的需要定位多個(gè)對(duì)象的時(shí)候,你應(yīng)該使用顯示等待,對(duì)我來說,這樣有意義。

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

  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.

  當(dāng)在使用Chromedirver時(shí),設(shè)定瀏覽器窗口初始化大小

  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 上都工作正常。壞消息是,對(duì)于Java , C# 和Python 的coder 來說,看上去現(xiàn)在Java版本的webdriver還不支持設(shè)定chrome 的屬性。 你好是基于現(xiàn)有的FirefoxProfile 類來創(chuàng)建一個(gè)ChromeProfile 類。

  Scroll to a button before clicking it.

  滾動(dòng)到相應(yīng)的button后才點(diǎn)擊

  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.

  點(diǎn)擊button有時(shí)候會(huì)無故失敗,這可能是由于selenium 執(zhí)行點(diǎn)擊命令的時(shí)候,這個(gè)button在視圖之外。所以解決這個(gè)問題的其中一個(gè)方法是,滾動(dòng)到相應(yīng)的button后才點(diǎn)擊。

上一頁12下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請(qǐng)使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: 成人在免费观看视频国产 | 国产女人伦码一区二区三区不卡 | 日韩福利视频一区 | 国产精品久久天天影视 | 久久大香伊蕉在人线国产联合 | 99re视频这里只有精品 | 欧美日韩国产精品 | 亚洲国产精品+制服丝袜 | 午夜视频吧| 51免费看片| 日韩理论视频 | 新香蕉视频在线 | 好深好爽456自拍视频 | 久久人人爱 | 色噜噜狠狠狠色综合久 | 污视频18高清在线观看 | 日本免费观看95视频网站 | 国产片一级aaa毛片视频 | 国产自产视频在线观看香蕉 | 国产不卡一区二区视频免费 | 精品久久久久久国产91 | 国产亚洲欧美久久精品 | 国产一区二区三区高清 | 91精品观看91久久久久久 | 成人欧美精品一区二区不卡 | 亚洲 欧美 日韩 综合 | 日本在线不卡一区二区 | 日韩精品一区二区三区中文3d | 欧美一区二区在线观看视频 | 国产成人精品男人的天堂538 | 国内自拍欧美 | 小明tv| 日本中文字幕一区二区有码在线 | 亚洲欧美日韩伦中文 | 国产精品手机视频 | 欧美一区二区三区高清不卡tv | 又黄又爽又色的视频在线看 | 男人av的天堂 | 波多野结衣视频在线看 | 香蕉草草久在视频在线播放 | 怡红院日本一道日本久久 |