2011-04-21 2 views
1

현재 문서 URL을 새 것으로 바꾸고 그 URL로 진행하려는 canoo webtest가 있습니다. 특히, 현재 문서 URL의 "view.html"문자열을 "view-old.html"로 바꾸고 새 URL로 이동하려고합니다.canoo webtest에서 URL을 바꾸는 방법

<clickButton htmlId="newDocForm_add"/> 
<!-- get the url of the newly loaded page and replace "view" with "view-old" --> 
<???> 
<invoke description="go to modified URL" url="...newUrl..."/> 

답변

0

내가 fianlly 결국 :

스크립트는 같을 것이다 원래 URL에서 찾을 수있는 ID 입력란에서 수정 된 URL을 생성하여 다르게 처리합니다.

<sequential> 
    <ifStep description="if in new document edit, go to old version"> 
     <condition description="in new doc edit"> 
     <verifyDocumentURL text=".*/doc/view.html.*" regex="true" description="new doc edit url" /> 
     </condition> 
     <then> 
     <storeXPath description="Extract transaction id" 
        xpath="//form[@id='docdata-form']/input[@name='transaction.id']/@value" 
        property="transid" /> 
     <invoke description="Go to old edit page" url="/doc/view-old.html?id=#{transid}" /> 
     </then> 
    </ifStep> 
    </sequential> 
관련 문제