Position issue on Bellatrix.ImageRecognition
Home › Forum › Web › General Discussion › Position issue on Bellatrix.ImageRecognition
-
AuthorPosts
-
December 17, 2020 at 12:25 pm #3607
Hello,
this is my second issue with Bellatrix tool. I’m using Bellatrix.ImageRecognition for Web to click on some area. But seems SikuliX has a bug with correct detecting the position the image or may be the issue with similarity. Does there any way to solve this blocker for me?
Regards,
Mari
-
December 17, 2020 at 12:29 pm #3608
Hi Mari,
Can you please provide some code and explain what you want to achieve. We use heavily the SikuliX for some of our projects and it is working just fine. Maybe it is something related to the context you are trying to automate. Please share some code, webistes, etc. and I will try to help.
Best,
Anton
Co-Founder and CTO Automate The Planet
Inventor Bellatrix Test Automation Framework -
December 17, 2020 at 12:40 pm #3609
Thank you very much for your quick response.
I’ve created test case under Bellatrix project Bellatrix.Web.MSTest.Tests.
installed Bellatrix.ImageRecognition
the image with name ClickOnSubmit is embedder resource and it is logo on page http://demos.bellatrix.solutions/my-account/,
but instead of clicking on LOGO it clicks on Checkout menu. Also one note, case shows as passed, but I can see that it click on wrong position. I’ve tried to change similarity, also added Point as argument of click, but no succeed.using System;
using System.Drawing;
using Bellatrix.ImageRecognition;
using Bellatrix.Web;
using Microsoft.VisualStudio.TestTools.UnitTesting;namespace Bellatrix.Web.MSTest.Tests
{
[TestClass]
[Browser(BrowserType.Chrome, BrowserBehavior.ReuseIfStarted)]
[VideoRecording(VideoRecordingMode.DoNotRecord)]
[ScreenshotOnFail(true)]
public class ImgTests : WebTest
{
public override void TestInit() => App.NavigationService.Navigate(“http://demos.bellatrix.solutions/my-account/”);[TestMethod]
////[VideoRecording(VideoRecordingMode.Ignore)]
////[ScreenshotOnFail(false)]
public void ClickOnLogo()
{Screen sc = new Screen();
sc.Click(“ClickOnSubmit”, similarity: 0.9, timeoutInSeconds: 10);}
}
}-
This reply was modified 1 month, 1 week ago by
mari.margaryan86.
-
This reply was modified 1 month, 1 week ago by
-
December 17, 2020 at 2:19 pm #3611
if the example is against our demo website, can you please delete the bin and obj folders, zip the project and attach it here so that I can directly debug it and give you suggestion?
Best,
Anton
Co-Founder and CTO Automate The Planet
Inventor Bellatrix Test Automation Framework -
December 17, 2020 at 2:56 pm #3612
-
December 17, 2020 at 3:01 pm #3613
-
December 17, 2020 at 3:06 pm #3614
-
December 17, 2020 at 3:11 pm #3616
From what I see, you are trying to click on the wrong logo. I mean you are using the wrong image name – since you navigating to bellatrix demo website I guess you are trying to click on bellatrix logo so you should click on the “Logo” image.
Best,
Anton
Co-Founder and CTO Automate The Planet
Inventor Bellatrix Test Automation Framework -
December 17, 2020 at 3:14 pm #3617
-
December 17, 2020 at 4:50 pm #3618
-
December 18, 2020 at 8:50 am #3619
First of all would say tank you for trying to help me, but sc.Click(“Logo”) again doesn’t work for me, but I figure out the cause of this issue.
it depends from the value of display settings Scale and Layout, my default and recommended value was 150%, I changed it to 125%, take new image of logo, and it started to work. I don’t know it is something that you need to fix or may be include in documentation.
Thanks,
Mari
-
December 18, 2020 at 9:12 am #3620
Thank you for sharing this, I hear for this problem for the first time. Is this Scale & Layout a setting of your Windows? Or this is the zoom level of the browser? Anyway, I am glad that in the end it worked for you. We are trying to test the new releases of the framework a lot before official announcement so I was surprised.
Best,
Anton
Co-Founder and CTO Automate The Planet
Inventor Bellatrix Test Automation Framework -
December 18, 2020 at 9:29 am #3621
-
AuthorPosts
You must be logged in to reply to this topic.