开发者

Need some help or suggests about programming some groovy script for SoapUI tests

开发者 https://www.devze.com 2023-03-06 14:42 出处:网络
Im working with SoapUI less 1 months. Today Im got a task related with a cheking image size, which we get in RSS from server. And I must to check all image size in accordance with requirements.

Im working with SoapUI less 1 months. Today Im got a task related with a cheking image size, which we get in RSS from server. And I must to check all image size in accordance with requirements. What can I do to make sure that I was able to enter the some sizes of images in the script, and he could verify the conformity of these sizes with a sizes of which we gave from the server? For example, I have a requirement, that the image size must开发者_StackOverflow have 200x200 size, and I want to check that the size of some image have this size really. I'll be very grateful for some help. Thanks.


Your question does not have much information to go on, but here is the basic outline.

Get the <url/> sub-element of the <image/> element from RSS, and use:

def img = ImageIO.read(url)

Now you can call img.height and img.width to get the size of the image, which you can compare against the expected value (or the values specified in the <width/> and <height/> sub-elements in the RSS file).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号