can we identify that an error message box has appeared
-
- Posts: 26
- Joined: Thu Jan 18, 2007 12:04 pm
can we identify that an error message box has appeared
can we identify that an error message box has appeared while performing an automated testing on a software using ranorex .....Note that the error message box has poped up from the software which I am testing
A message box is a top level window, you should use the Application.FindFormTitle function to find it:
See also the sample RanorexVS2003Sample3
Gabor Herget
Ranorex Team
Code: Select all
Form messageBox = Application.FindFormTitle("MessageBox title", SearchMatchMode.MatchExact, true, 100);
Control control = messageBox.FindChildText("OK", SearchMatchMode.MatchExact);
Mouse.ClickControl(control);
Gabor Herget
Ranorex Team
-
- Posts: 26
- Joined: Thu Jan 18, 2007 12:04 pm
Still have problem
First of all thanks for such a quick responce....
but my problem is not solved by that answer
as per given code we shold know the title of
error message and other details but I want to
know that is there any way to identify it without
having details of the error message form. I mean
the program itself identify that the opened window
is an error window while performing some automated
task on some application.
but my problem is not solved by that answer
as per given code we shold know the title of
error message and other details but I want to
know that is there any way to identify it without
having details of the error message form. I mean
the program itself identify that the opened window
is an error window while performing some automated
task on some application.
You can get the active form with the Application.Active property.
If the active form is not your test application, then check if it's a message box.
Jenö Herget
Ranorex Team
If the active form is not your test application, then check if it's a message box.
Code: Select all
Form activeForm = Application.Active;
Console.WriteLine("ActiveForm Title={0} ClassName={1}",
activeForm.Text, activeForm.ClassName);
Ranorex Team
-
- Posts: 26
- Joined: Thu Jan 18, 2007 12:04 pm
ok thats nice technique
could u tell me in which version of ranorex Application.Active is available.
Is it in free version ?
Is it in free version ?
-
- Posts: 2
- Joined: Thu Oct 25, 2007 5:13 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Please use the Form.Active property in V1.2 or higher.
You get the currently active top level form.
Jenö
Ranorex Team
Code: Select all
public static Form Active { get; }
Jenö
Ranorex Team