我使用 SoapUI 的时间不到 1 个月。今天我有一个与检查图像大小相关的任务,我们从服务器的 RSS 中获取该图像大小。我必须按照要求检查所有图像尺寸。
我该怎么做才能确保我能够在脚本中输入某些尺寸的图像,并且他可以验证这些尺寸与我们从服务器提供的尺寸是否一致?例如,我有一个要求,图像尺寸必须为200x200尺寸,并且我想检查某些图像的尺寸是否确实具有这个尺寸。
我将非常感谢您的帮助。谢谢。
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 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.
发布评论
评论(1)
您的问题没有太多信息可继续,但这是基本轮廓。
获取 子元素>
来自 RSS 的元素,并使用:
现在您可以调用
img.height
和img.width
获取图像的大小,您可以将其与预期值(或
和
中指定的值进行比较) RSS 文件中的子元素)。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:Now you can call
img.height
andimg.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).