2016-04-14 6 views
0

Alert/Confirmation Messageの値をSelenium IDEに保存する方法は?Alert Messageの値をSelenium IDEに保存する

とも

+0

storeAlertのドキュメントの最後の2段落を読んでください。警告メッセージが表示された場合、あなたは立ち往生しています。 Seleniumは自動的に関数をインターセプトするためにロードするすべてのページに対してwindow.alertを再定義する必要があります。ページがonloadイベントの前にメッセージを警告する場合、Seleniumにはそのような機会はありません。 (ネイティブのwindow.alertを想定し、JSウィジェットは想定していません)。 –

答えて

1

StoreAlertとStoreConfiramtion警告メッセージの[OK]ボタンを

をクリックする方法を説明してくださいstoreAlert

Returns: 
    The message of the most recent JavaScript alert 

Retrieves the message of a JavaScript alert generated during the previous action, or fail if there were no alerts. 

Getting an alert has the same effect as manually clicking OK. If an alert is generated but you do not consume it with getAlert, the next Selenium action will fail. 

Under Selenium, JavaScript alerts will NOT pop up a visible alert dialog. 

Selenium does NOT support JavaScript alerts that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until someone manually clicks OK. 

storeConfirmation

Returns: 
    the message of the most recent JavaScript confirmation dialog 

Retrieves the message of a JavaScript confirmation dialog generated during the previous action. 

By default, the confirm function will return true, having the same effect as manually clicking OK. This can be changed by prior execution of the chooseCancelOnNextConfirmation command. 

If an confirmation is generated but you do not consume it with getConfirmation, the next Selenium action will fail. 

NOTE: under Selenium, JavaScript confirmations will NOT pop up a visible dialog. 

NOTE: Selenium does NOT support JavaScript confirmations that are generated in a page's onload() event handler. In this case a visible dialog WILL be generated and Selenium will hang until you manually click OK. 
関連する問題