groovy スクリプトと soapUI を使用してテスト ケースを自動化しようとしました。
ソープリクエストを送信すると、企業リストを含むレスポンスが返ってきました。私がやりたいのは、上場企業の名前を検証することです。応答配列のサイズは固定されていません。
それで、最初だけ以下のスクリプトを試しましたが、行き詰まりました..
def count = context.expand( '${Properties#count}' )
count = count.toInteger()
def i = 0
while (i<count)
(
def response = context.expand( '${getCompanyList#Response#//multiRef['+i+']/@id}' )
log.info(response)
i=İ+1
)
私は得る
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script12.groovy: 6: unexpected token: def @ line 6, column 1. def response = context.expand( '${getCompanyList#Response#//multiRef['+i+']/@id}' ) ^ org.codehaus.groovy.syntax.SyntaxException: unexpected token: def @ line 6, column 1. at
どういうわけか「応答」定義に「i」を入れるべきです..