簡體   English   中英

有沒有一種方法可以運行帶有Ruby綁定測試套件的Selenium Webdriver,一旦完成運行,就可以在irb中進一步編寫測試了嗎?

[英]Is there a way I can run Selenium Webdriver with Ruby bindings test suite and once it is done running, carry on writing tests further in irb?

我正在使用Selenium Webdriver和Ruby Bindings運行測試套件。 每次我必須為新功能編寫腳本時,都必須在IRB中手動運行整個代碼,以達到特定的級別,從那里可以對CSS Selector方法進行反復試驗。

這樣做的全部目的是避免手動運行腳本,因為這很耗時。

謝謝阿比舍克

如果您使用的是irb,則無需運行整個代碼。 與其在要使用選擇器方法檢查的點之前執行整個代碼,不如手動執行這些步驟,然后對要檢查的元素進行反復試驗。 當然,您必須在irb中創建瀏覽器實例,如下所示:

require 'selenium-webdriver'
driver = Selenium::WebDriver.for :firefox
# here perform manual steps to reach to point where you want to perform trial and error and then try with trial and error
driver.find_element(:css, "css_selector")

編輯:

如果您想通過腳本執行以上操作,請轉到此處

暫無
暫無

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

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