0

WebAii Framewok を使用したテスト - 現在、自分のコードがどのウィンドウにフォーカスされているかを判断できないところに行き詰まっています。このコードは、A とは言わないでページを開き、リンクをクリックすると新しい子ウィンドウが開きます。これを B と呼びます。ページ/ウィンドウ B にアクセスするにはどうすればよいですか? ページ B のリンクをクリックするにはどうすればよいですか?

あなたの助けに感謝します。

ありがとう、ドットネット初心者

4

1 に答える 1

1

You can connect to a new window by using the call Manager.WaitForNewBrowserConnect() followed by Manager.ActiveBrowser.WaitUntilReady(). The first method takes three parameters: a string for the URL to connect to with the new window, a boolean setting whether or not to use partial URL matching, and a timeout.

You'll be connected to the new window. From that point on you continue with your steps as usual.

For example, on a demo app I have I use a coded step with:

Manager.WaitForNewBrowserConnect("http://localhost:3000/contacts/16/edit", true, 5000); Manager.ActiveBrowser.WaitUntilReady();

Subsequent steps work just like normal.

于 2011-10-25T18:08:30.343 に答える