Ranorex.CommandFailedException / SerializationException
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
Ranorex.CommandFailedException / SerializationException
Environment:
.Net 1.1, Tests runs with NUnit 2.4, 30 Tests with a long total-duration (ca. 0,5h). Exceptions occurs only after much time is elapsed, never at begin of tests.
Exception:
System.Runtime.Serialization.SerializationException: The type Ranorex.CommandFailedException in Assembly RanorexNet, Version=1.5.0.3287, Culture=neutral, PublicKeyToken=60ca58ec175a86b8 is not marked as serializable.
...no further information
What reasons can this Ex. have ? Are there enhanced trace-capabilities ?
regards
Jörg
.Net 1.1, Tests runs with NUnit 2.4, 30 Tests with a long total-duration (ca. 0,5h). Exceptions occurs only after much time is elapsed, never at begin of tests.
Exception:
System.Runtime.Serialization.SerializationException: The type Ranorex.CommandFailedException in Assembly RanorexNet, Version=1.5.0.3287, Culture=neutral, PublicKeyToken=60ca58ec175a86b8 is not marked as serializable.
...no further information
What reasons can this Ex. have ? Are there enhanced trace-capabilities ?
regards
Jörg
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Please post the message you get by calling the ToString() method of the exception, e.g.:
Which method is causing the exception?
Regards,
Alex
Code: Select all
try
{
// exception is thrown somewhere here
}
catch (Exception ex)
{
string message = ex.ToString();
}
Regards,
Alex
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
this method causes the exception:
_obj = _control.Element.FindChild(role, this.GetType().Name);
role = Role.Toolbar
VS- Output:
Eine Ausnahme (erste Chance) des Typs 'Ranorex.CommandFailedException' ist in ranorexnet.dll aufgetreten.
Zusätzliche Informationen: The specified command could not be executed.
thats all !
Regards Jörg
_obj = _control.Element.FindChild(role, this.GetType().Name);
role = Role.Toolbar
VS- Output:
Eine Ausnahme (erste Chance) des Typs 'Ranorex.CommandFailedException' ist in ranorexnet.dll aufgetreten.
Zusätzliche Informationen: The specified command could not be executed.
thats all !
Regards Jörg
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
This could be a timing issue.
Can you please try the following:
or
Jenö
Ranorex Team
Can you please try the following:
Code: Select all
_obj = _control.Element.FindChild(role, this.GetType().Name);
if( _obj == null )
{
Application.Sleep(500);
_obj = _control.Element.FindChild(role, this.GetType().Name);
}
Code: Select all
try
{
_obj = _control.Element.FindChild(role, this.GetType().Name);
}
catch (Ranorex.RanorexException)
{
Application.Sleep(500);
_obj = _control.Element.FindChild(role, this.GetType().Name);
}
Ranorex Team
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
You could also try the same without element caching:
Jenö
Ranorex Team
Code: Select all
Ranorex.Element.EnableCaching = false;
Ranorex Team
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
no success so far
Some more constraints:
It seems to happen only at Element-Level.
In case of Failure, the testbench teardowns the whole SUT (Software under Test) and setup it again. Then the Test searches successful again the Form with Application.FindForm... and also find a control. But the 1st access at Element-Level fails again. From this point, all Element accesses fails, seems as Ranorex remains in a failed-mode after the 1st failure.
When i suspend the test and the SUT is left running, a new start of an Test with an Element-Access is successful again.
Note: The 1st failure happens always(?) when i access a Exceed-Control
regards Jörg
Some more constraints:
It seems to happen only at Element-Level.
In case of Failure, the testbench teardowns the whole SUT (Software under Test) and setup it again. Then the Test searches successful again the Form with Application.FindForm... and also find a control. But the 1st access at Element-Level fails again. From this point, all Element accesses fails, seems as Ranorex remains in a failed-mode after the 1st failure.
When i suspend the test and the SUT is left running, a new start of an Test with an Element-Access is successful again.
Note: The 1st failure happens always(?) when i access a Exceed-Control
regards Jörg
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Is the Exceed-Control a 3rd party control? This bug can also happen if the control does not support MSAA (Microsoft Active Accessibility) correctly.so far only with a Exceed-Control
If the control is a Windows Forms Control, then you may have another possibility. Please check the extended properties of the control with RanorexSpyPro. Drag the finder tool of the Spy to the control and check the right side of the Spy window. If the Spy shows the properties of the control, then you can also automate it with the Control.InvokeMethod function.It is a Windows Forms Control
Jenö
Ranorex Team
-
- Posts: 55
- Joined: Thu Aug 23, 2007 12:00 pm
Re: Ranorex.CommandFailedException / SerializationException
i have further analyzed the problem. The Element-structure we use is as follows:
Nameless-Client-Element
'- ElementName (Value="MyTextbox")
'- Another
'- Another2
'- Container
'- Textbox-Element(Value="the Text")
Used Algorithm:
FindChildValue("MyTextbox").Parent.FindChild(Role.Text)
Mostly, the Parent is correct (4 childs as in example) and the following FindChild-Command is succesful, but rarely the parent has only 2 childs and the child structure is a infinite recursion of empty clients, so the following FinChild causes the CommandFailed-Exception.
regards Jörg
Nameless-Client-Element
'- ElementName (Value="MyTextbox")
'- Another
'- Another2
'- Container
'- Textbox-Element(Value="the Text")
Used Algorithm:
FindChildValue("MyTextbox").Parent.FindChild(Role.Text)
Mostly, the Parent is correct (4 childs as in example) and the following FindChild-Command is succesful, but rarely the parent has only 2 childs and the child structure is a infinite recursion of empty clients, so the following FinChild causes the CommandFailed-Exception.
regards Jörg
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Ranorex.CommandFailedException / SerializationException
Hi Jörg!
We will release a new V1.5.2 with some bug fixes (but no new features) in the near future.
I have sent you a download link of the first Beta.
Please try this version and inform us about the results.
Jenö
Ranorex Team
We will release a new V1.5.2 with some bug fixes (but no new features) in the near future.
I have sent you a download link of the first Beta.
Please try this version and inform us about the results.
Jenö
Ranorex Team