2011-10-27 6 views
0

예제를 게시하고 셀렌 IDE의 솔루션이 무엇인지 알고 싶으면 스크립트를 중지하지 않고 "모달"창에서 작동하십시오. 나는 온라인 예와 내가 만든 스크립트를 제공 할 것입니다 : 상세하지 않는 작업 ...Selenium ShowDialogic Modal

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
<head profile="http://selenium-ide.openqa.org/profiles/test-case"> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<link rel="selenium.base" 
    href="http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/showModalDialog2.htm" /> 
<title>New Test</title> 
</head> 
<body> 
    <table cellpadding="1" cellspacing="1" border="1"> 
     <thead> 
      <tr> 
       <td rowspan="1" colspan="3">New Test</td> 
      </tr> 
     </thead> 
     <tbody> 
      <!--//Open the application and wait to load the combobox--> 
      <tr> 
       <td>open</td> 

       <td>/workshop/samples/author/dhtml/refs/showModalDialog2.htm</td> 
       <td></td> 
      </tr> 
      <tr> 
       <td>waitForElementPresent</td> 

       <td>name=oHeight</td> 
       <td></td> 
      </tr> 
      <!--//Insert height value and click "Push To Create" button--> 
      <tr> 
       <td>select</td> 

       <td>name=oHeight</td> 
       <td>label=250</td> 
      </tr> 
      <tr> 
       <td>click</td> 
       <td>css=input[type=&quot;button&quot;]</td> 
       <td></td> 
      </tr> 
      <!--//Wait for the loading the modal page title and check the text --> 
      <tr> 
       <td>waitForElementPresent</td> 

       <td>//h1</td> 
       <td></td> 
      </tr> 
      <tr> 
       <td>verifyTextPresent</td> 
       <td>This is a modal dialog box. This page is not designed to do 
        anything except display the dialog box arguments.</td> 
       <td></td> 
      </tr> 
      <!--//close the screen and verify that the previous screen is loaded from the height field--> 
      <tr> 
       <td>close</td> 
       <td></td> 

       <td></td> 
      </tr> 
      <tr> 
       <td>selectWindow</td> 
       <td>null</td> 
       <td></td> 
      </tr> 
      <tr> 
       <td>waitForElementPresent</td> 
       <td>name=oHeight</td> 
       <td></td> 
      </tr> 

     </tbody> 
    </table> 
</body> 
</html> 

답변

0

웹 애플리케이션이 실제로 브라우저 대화 상자의 예외 (예를 들어,으로, 모달 대화 상자가없는 "다른 이름으로 파일 저장 ...") 및 JavaScript의 window.alert(), window.prompt()window.confirm()입니다. 그 밖의 모든 기능은 별도의 창 (기존 웹 앱에서와 같이) 또는 그 뒤에있는 요소에 대한 액세스를 차단하는 오버레이 (현대, AJAXy, 웹 앱에서와 같이)입니다.

별도의 창을 사용하는 경우 waitForPopUp ...windowname...을 입력하고 selectWindow ...windowname...을 입력 한 다음 selectWindow (이름없이)을 눌러 전환해야합니다.

오버레이의 경우 페이지의 다른 것과 마찬가지로 주소를 지정할 수 있지만 요소 로케이터가 무엇인지 (또는 그렇지 않을 수도 있음) 놀랄 수 있습니다. Firefox의 "XPather"또는 "Firebug"부가 기능을 사용하여 올바른 XPath 표현식을 찾습니다.

+0

스크립트를 수정하여 작동되게 할 수 있습니까? 텍사스 –