Position issue on Bellatrix.ImageRecognition

Home Forum Web General Discussion Position issue on Bellatrix.ImageRecognition

  • Author
    Posts
  • #3607
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    @mari-margaryan86

    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

  • #3608
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    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

  • #3609
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    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.
  • #3611
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    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

  • #3612
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    here is a project.

    thank you for your help.

  • #3613
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    have you forgot to attach the file or there is a bug in the forums about attaching files since I cannot see it?

    Best,
    Anton
    Co-Founder and CTO Automate The Planet
    Inventor Bellatrix Test Automation Framework

  • #3614
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    oh,, there was an error on uploading   “Sorry, this file type is not permitted for security reasons” for 7z format,

    now sending zip

     

    Attachments:
    You must be logged in to view attached files.
  • #3616
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    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

  • #3617
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    I forgot to change the image name, would you please use Logo.png. I had issue using that image file.

  • #3618
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    I tried it. Can you change just to –

    sc.Click(“Logo”);

    for me this is working.

    Best,
    Anton
    Co-Founder and CTO Automate The Planet
    Inventor Bellatrix Test Automation Framework

  • #3619
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    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

     

     

  • #3620
    Helpful
    Up
    0
    Down
    Not Helpful

    aangelov
    Keymaster
    @anton1

    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

  • #3621
    Helpful
    Up
    0
    Down
    Not Helpful

    mari.margaryan86
    Participant
    Participant
    @mari-margaryan86

    It is windows display settings, see attached img

     

    Attachments:
    You must be logged in to view attached files.

You must be logged in to reply to this topic.