简体   繁体   English

Sikuli IDE映像替换是否可以解决?

[英]Is there any work around for Sikuli IDE image replacement?

I am using Sikulix for UI testing, the problem is that when ever there are changes in UI I need to replace all the images which got changed using the IDE and I need to again describe the actions ( accuracy, click position) which is becoming a sort of overhead in my case. 我正在使用Sikulix进行UI测试,问题是,当UI发生变化时,我需要替换所有使用IDE更改过的图像,并且我需要再次描述动作(准确性,点击位置),就我而言,这有点开销。 Is there any work around by which I can simply replace the new UI images in the project folder with the same old name ( It wont work directly as the new coordinates might be different + the new image should be of same resolution that of older one) 是否有任何解决方法,我可以简单地用相同的旧名称替换项目文件夹中的新UI图像(它不能直接工作,因为新坐标可能有所不同+新图像的分辨率应与旧图像的分辨率相同)

PS: I have completely understood that sikuli works at pixel level, but still curious to find out if any one has found a work around. PS:我完全理解sikuli在像素级别有效,但仍然想知道是否有人找到了解决方法。

Unfortunately, you will need to recreate the images. 不幸的是,您将需要重新创建图像。 What could make it a bit easier, is if you had more descriptive names than the ones generated by Sikuli IDE automatically. 如果您拥有比Sikuli IDE自动生成的描述性名称更多的描述性名称,那可能会使它更容易些。 Keep in mind these are just image files stored on your PC. 请记住,这些只是存储在您PC上的图像文件。 If you have names like button1.png , button1.png , etc.., it will make your life easier. 如果您具有button1.pngbutton1.png等名称,则将使您的生活更轻松。

This may or may not work for you depending on your project development: 根据您的项目开发情况,这可能对您不起作用:

In my case, the changes that occur at times reduces the image similarity from say 0.9 defined to ~0.7. 在我的情况下,有时发生的更改将图像相似性从例如0.9定义为降低到〜0.7。 Now, rather than going ahead to replace the image with a totally new image where i would have to manipulate the offsets as well now, I capture the same region image at 0.7 similarity and replace it. 现在,我不再需要用全新的图像替换图像,而现在我也必须操纵偏移量,而是以0.7的相似度捕获相同的区域图像并将其替换。 You can easily create a script for this and even integrate it into your project. 您可以为此轻松创建脚本,甚至可以将其集成到您的项目中。 Use find to figure out the matching region and capture to take the screenshot of the area. 使用find找出匹配的区域并捕获以截取该区域的屏幕截图。 The image caught using this way will now again match at 100% for you also, you have rid yourself from the headache of adjusting the targetoffset. 现在,使用这种方法捕获的图像也将再次以100%的比例匹配,这使您摆脱了调整目标偏移的麻烦。 Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM