Need some help or suggests about programming some groovy script for SoapUI tests
Im working with SoapUI less 1 months. Today I
m 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).
精彩评论