1

Selenium for Java を使用して、2 つの要素の設定を自動化しようとしています -Merchant integration version (v5/v6)https://stage.masterpassteststore.com/configurationページ。Merchant Checkout ID (Sandbox-V7-STD-9CCBB)

環境の設定は既に解決しました(Sandbox/Production)が、それ以上はありません。

        // Setting the environment
        try {
            Select environments = new Select((new WebDriverWait(driver, 5).until(ExpectedConditions.elementToBeClickable(By.id("select_environment")))));

            environments.selectByVisibleText("Sandbox");

            System.out.println("Selected environment: " + environments.getFirstSelectedOption().getText());

            System.out.println("Number of selected environments: " + environments.getAllSelectedOptions().size());

            } catch ( Exception e ) {
            System.out.println("Setting the environment failed. " + e.getMessage());}

        driver.quit();
    }
}

より賢い人々からの助けを歓迎します。:)

「Dmitri T」からの唯一の提案は、以下のエラーで終わります。

ポート 37781 で ChromeDriver 75.0.3770.140 (2d9f97485c7b07dc18a74666574f19176731995c-refs/branch-heads/3770@{#1155}) を起動すると、ローカル接続のみが許可されます。悪意のあるコードによるアクセスを防ぐために、ChromeDriver および関連するテスト フレームワークで使用されるポートを保護してください。Srp 23、2019 12:57:04 ODP。org.openqa.selenium.remote.ProtocolHandshake createSession INFO: 検出された方言: W3C 環境が正常に選択されました: スレッド「メイン」でサンドボックス例外が発生しました、464)。他の要素はクリックを受け取ります: ... (セッション情報: chrome=75.0.3770.80) ビルド情報: バージョン: '3.9.1'、リビジョン: '63f7b50'、時間: '2018-02-07T22:42:22.379Z ' システム情報: ホスト: '*'、ip: '10.45.1.194'、os.name: 'Windows 7'、os.arch: 'amd64'、os.version: '6.1'、java.version: '1.8.0_221' ドライバー情報: org. openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 75.0.3770.80, chrome: {chromedriverVersion: 75.0.3770.140 (2d9f97485c7b..., userDataDir: C:\Users*)\AppDat...}, goog:chromeOptions: {debuggerAddress: localhost:55213}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability : false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: disconnect and notify} セッション ID: 903a3ae8fe6f8d9e7260742bb2ffa419 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:62) で sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) で java.lang.reflect.Constructor.newInstance(Constructor.java:423) で org.openqa.selenium.remote.http.W3CHttpResponseCodec .createException(W3CHttpResponseCodec.java:187) 組織で。openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor. org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) で実行 (HttpCommandExecutor.java:160) org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) で org .openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279) で org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) で App.main(App.java:36)org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) で実行 (HttpCommandExecutor.java:160) org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) で org .openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279) で org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) で App.main(App.java:36)org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) で実行 (HttpCommandExecutor.java:160) org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) で org .openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:279) で org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) で App.main(App.java:36)


4

1 に答える 1