我們有一個應用程序,我們有一個客戶模塊。 這將顯示字段的下方 客戶名稱 地址1 地址2 市 國家如何在selenium Web驅動程序中自動化SOAP UI
要提取網頁中的客戶模塊的記錄,我們需要給肥皂UI輸入數據,一旦執行後從肥皂用戶界面,新用戶將創建並顯示在用戶界面網頁中。 我們如何通過硒Web驅動程序自動執行此過程。
我們有一個應用程序,我們有一個客戶模塊。 這將顯示字段的下方 客戶名稱 地址1 地址2 市 國家如何在selenium Web驅動程序中自動化SOAP UI
要提取網頁中的客戶模塊的記錄,我們需要給肥皂UI輸入數據,一旦執行後從肥皂用戶界面,新用戶將創建並顯示在用戶界面網頁中。 我們如何通過硒Web驅動程序自動執行此過程。
所以最明顯的,也許是最簡單的方法,讓硒和了SoapUI合作是:
%SOAPUI_HOME%\bin\ext
)。package
線,刪除class Selenium2Example
和void main
行以及關閉 括號,並將System.out.println
更改爲log.info
。我的最後 (完整)測試代碼如下。示例代碼:
import org.openqa.selenium.By
import org.openqa.selenium.WebDriver
import org.openqa.selenium.WebElement
import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.support.ui.ExpectedCondition
import org.openqa.selenium.support.ui.WebDriverWait
// Create a new instance of the Firefox driver
// Notice that the remainder of the code relies on the interface,
// not the implementation.
WebDriver driver = new FirefoxDriver()
// And now use this to visit Google
driver.get("http://www.google.com")
// Find the text input element by its name
WebElement element = driver.findElement(By.name("q"))
// Enter something to search for
element.sendKeys("Cheese!")
// Now submit the form. WebDriver will find the form for us from the element
element.submit()
// Check the title of the page
log.info("Page title is: " + driver.getTitle())
// Google's search is rendered dynamically with JavaScript.
// Wait for the page to load, timeout after 10 seconds
(new WebDriverWait(driver, 10)).until(new ExpectedCondition() {
public Boolean apply(WebDriver d) {
return d.getTitle().toLowerCase().startsWith("cheese!")
}
});
// Should see: "cheese! - Google Search"
log.info("Page title is: " + driver.getTitle())
//Close the browser
driver.quit()
這個答案是從my blog一個複製粘貼。
將soapUI與您的硒測試套件集成是不值得的海事組織。我建議在你的硒套件中創建一個類來執行創建用戶的服務調用,並將該步驟作爲數據設置的一部分... 即使您不知道如何執行該操作,更少的時間和精力來學習在硒框架內進行服務調用,而不是嘗試在硒測試中嘗試使用一些monkeypatch來調用soapui ... – Bodao
您可以創建一些在測試運行之前正在執行的安裝腳本。肥皂客戶端的例子可以在這裏找到http://stackoverflow.com/q/15948927/2504101 – olyv
如果你想使用soapui API然後看看http://stackoverflow.com/questions/16773173/how-to-創建一個soap-ui-project-and-run-requests-it-in-java - @priti的回答 – Kavan