0

支払いアプリケーションをテストしています。手順は

  1. 最初に支払い Web サービス呼び出しを実行します。
  2. 支払い応答を開始すると、ログイン URL が返されます。
  3. 応答から URL を取得し、ブラウザで起動します
  4. ユーザー名とパスワードを入力します。
  5. ログインを選択します。次の画面に移動します(たとえば、画面2)
  6. ここで、cvc を渡し、確認を選択する必要があります

3番目のステップまでは機能しています。しかし、私は4番目のステップでHTTPリクエストを使用しています。しかし、リクエストでユーザー名とパスワードが渡されず、解決方法がわかりません。

誰かが私を助けてくれれば、私にとっては簡単です。

ありがとう。

4

2 に答える 2

0

org.openqa.selenium.By インポート org.openqa.selenium.WebDriver インポート org.openqa.selenium.WebElement インポート org.openqa.selenium.firefox.FirefoxDriver インポート org.openqa.selenium.support.ui.ExpectedCondition インポート 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()
于 2012-09-27T10:32:10.310 に答える
0

私は同じ問題を抱えていましたが、ここに私の魂があります: 問題の説明: バックエンドで Web サイトを呼び出したいのですが、JSON で応答できました。タスクは、JSON 構造をテストすることでした。ログインサイトへのリダイレクトが常にあったため、それができませんでした。

解決策: 1. [サービス ビューアーの表示] に移動し、[サービス エンドポイント] バーをクリックします。http ドメインと正しいユーザー名とパスワードを入力します。たとえば、ブラウザからログインするときと同じように、"http://www.rocket.com/backend /homescreenJson"入力するよりも電話をかけ、サイトのユーザー名/パスを入力します。"endpont"="http://www.rocket.com2.soapUI の [ファイル]/[設定] をクリックし、[HTTP 設定] に移動して、[送信要求に認証設定を追加する] ボックスにチェックを入れます。

それは私のために働いた。乾杯、カロリー

于 2013-01-11T10:56:39.940 に答える