Image recognition failing after upgrade to 4.1.5

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
borisveis
Posts: 7
Joined: Tue Nov 12, 2013 3:02 am

Image recognition failing after upgrade to 4.1.5

Post by borisveis » Wed Mar 05, 2014 10:11 pm

As part of our product deployment, we have to interact with a VM console in VMware vSphere client. We've used image recognition (e.g., checking for a login prompt) before typing username/passwd or other CLI commands. Up until recently, Ranorex was handling this just fine. After upgrading to 4.1.5, the image is recognized in Ranorex Studio, but our runtime machine does not. I've upgraded the runtime machine to the same version as our Studio installs, but the problem still occurs.

Here's the user code we use to wait for the command prompt to appear which typically takes about 5-10 minutes.

Couple of questions regarding this code:
1. We intend to limit the search area to a subsection of the object. Is this code written correctly to only search within a certain area or is it doing image recognition on the entire object. As is, this code has been working for some time.
2. Is there a better way to "wait for image exists" logic?

Code: Select all

        	
public void Validate_MKSEmbedded1()
        {
            Report.Log(ReportLevel.Info, "Validation", "(Optional Action)\r\nValidating ContainsImage (Screenshot: 'scr_Initial_Login_Promt' with region {X=3,Y=62,Width=449,Height=19}) on item 'MkphysvcMkQaHytrustComVSphereCli.MainInventory.MKSEmbedded1'.", repo.MkphysvcMkQaHytrustComVSphereCli.MainInventory.MKSEmbedded1Info);
            int count = 0;
            bool found = false;
            Validate.EnableReport = false;
            do {
            	try {
            		if (Validate.ContainsImage(repo.MkphysvcMkQaHytrustComVSphereCli.MainInventory.MKSEmbedded1Info,
                                             MKSEmbedded1_scr_Initial_Login_Promt, MKSEmbedded1_scr_Initial_Login_Promt_Options,
                                             Validate.DefaultMessage, false)) {
            			found = true;
            		}
            	} catch (Exception e) {
            		e.ToString(); //line to save e for future use
            		//don't do anything
            	}
            	Thread.Sleep(1000);
            	count++;
            } while (!found && count <= 600);
            Validate.EnableReport = true;
            Report.Log(ReportLevel.Debug, "boot up took " + count);
The image I'm looking for is a Black/White console login prompt

borisveis
Posts: 7
Joined: Tue Nov 12, 2013 3:02 am

Re: Image recognition failing after upgrade to 4.1.5

Post by borisveis » Thu Mar 06, 2014 12:59 am

I think the issue was the resolution of the virtual machine screen. The images was clearly visible in the screen, but I increased the resolution anyways. Now it works.

There's was probably some part of the border that was missing causing the image to no be recognizable.