다음 시나리오와 관련된 문제가 있습니다.Watir의 대화 상자 다루기
Google 크롬을 사용하여 시스템에 로그인 할 테스트 스크립트를 작성 중입니다.
나는 Excel에서 데이터를 읽습니다.
첫 번째 데이터 집합에 잘못된 사용자 이름/암호 조합이 있습니다.
잘못된 암호를 입력하면 Username/Password가 올바르지 않다는 메시지와 함께 팝업 창이 나타납니다.
이 경우 팝업 창을 닫을 수 있어야하며 사용자 이름/암호 조합이 일치 할 때까지 watir은 Excel의 다음 데이터 집합을 읽어야합니다.
문제점 팝업 대화 상자를 감지하는 방법을 모르겠습니다. 다음과 같은 코드가 있습니다 :
<div id="alertMsg" style="width: auto; min-height: 76.69999980926514px; height: auto;" class="ui-dialog-content ui-widget-content"><div class="dialogBoxTitle"> </div>
<div class="alertMessage pointSearch">
<form name="saveComfortModelForm" class="pointSearchFrm">
<table cellpadding="0" cellspacing="0" width="100%" height="100%" class="pointSearchTable">
<tbody><tr>
<td>Login failed due to invalid password or username</td>
</tr>
</tbody></table>
</form>
</div></div>
또한 팝업이 닫히는 링크가 있습니다. 코드는 다음과 같습니다 :
<div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix">
<span class="ui-dialog-title" id="ui-dialog-title-alertMsg"> </span>
<a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button">
<span class="ui-icon ui-icon-closethick">close</span>
</a>
</div>
이 메시지가 표시되면 창을 닫아야합니다.