Page 1 of 1

Object Recognition of a Message Box is failing

Posted: Thu Dec 10, 2020 9:22 pm
by kdreiling
I am working on an older legacy forms app that the test suite has not been worked on in quite a while. Since that time, a form that used to pop up that allowed the user to select Yes - I want to log in or No - I don't want to log in has been converted to a message box. So when I open the application, the app actually starts up, but is hidden and the Message Box displays until Yes/No button is selected. The problem is that Ranorex does not recognize that message box. I am currently on 9.3.2 and about to upgrade to 9.3.4, but does anyone has any idea of a possible solution? Here is the code that is being called. Do I need to create some custom user code to click return on button1? Any suggestions are welcome.

iAnswer = System.Convert.ToInt16(MessageBox.Show("You are logging into a test Database! Are you sure you want to do this?", "Test Database!", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly));

if (iAnswer == (int)VB.MsgBoxResult.No)
{
// We end the program as this will take a config file edit to fix:
Application.Exit();
ProjectData.EndApp();
}

Re: Object Recognition of a Message Box is failing

Posted: Fri Dec 11, 2020 12:32 pm
by Stub
You're probably going to need to update your Rx repository to reflect the UI changes in your app, from a Form to a MessageBox. I'd compare and contrast the old and new versions in RxSpy to figure out the differences in addressing that are required.