Page 1 of 1

Not able to add objects using spy

Posted: Thu Dec 11, 2014 12:22 pm
by vamsi
Hello Sir,

While trying to add objects to the repository using ranorex spy the spy tool crashes and a bug is reported.
The application for which I am adding objects is a desktop based imaging application.

Logs:
System.ArgumentException: Parameter is not valid.
---STACKTRACE---
System.ArgumentException: Parameter is not valid.
System.Drawing.Bitmap..ctor(Int32 width,Int32 height,PixelFormat format)+0x0
Ranorex.Imaging.BlitFromDesktopDc(Rectangle region)+0x89
Ranorex.Imaging.CaptureDesktopImage(Rectangle rect)+0x0
Ranorex.Imaging.CaptureDesktopImageWithSurroundingAreaInternal(Element element,Nullable`1 mousePoint,Color highlightColor1,Color highlightColor2,Int32 alpha,Boolean firstOnly,Bitmap& elementImage)+0x217
Ranorex.Imaging.CaptureDesktopImagesWithSurroundingArea(Element element,Nullable`1 mousePoint,Color highlightColor1,Color highlightColor2,Int32 alpha,Bitmap& elemImage)+0xe
Ranorex.Addins.ElementTreeAutostartCommand.AddSelectedElementToActiveRepository(Boolean withSubNodes)+0xb8
Ranorex.Addins.ElementTreeAutostartCommand.elementTree_RequestRepositoryExport(Object sender,EventArgs e)+0x0
Ranorex.Controls.ElementTreeAdv.OnRequestRepositoryExport(EventArgs e)+0x8
Ranorex.Controls.ElementTreeAdv.sendToRepositoryToolStripMenuItem_Click(Object sender,EventArgs e)+0x0
System.Windows.Forms.ToolStripItem.RaiseEvent(Object key,EventArgs e)+0x0
System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)+0x17
System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)+0x3b
System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)+0xc7
System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e,ToolStripItemEventType met)+0x48
System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e,ToolStripItemEventType met)+0xcb
System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)+0x6f
System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)+0x0
System.Windows.Forms.Control.WmMouseUp(Message& m,MouseButtons button,Int32 clicks)+0x184
System.Windows.Forms.Control.WndProc(Message& m)+0x5fe
System.Windows.Forms.ScrollableControl.WndProc(Message& m)+0x3a
System.Windows.Forms.ToolStrip.WndProc(Message& m)+0xe7
System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)+0x71
System.Windows.Forms.Control+ControlNativeWindow.OnMessage(Message& m)+0x0
System.Windows.Forms.Control+ControlNativeWindow.WndProc(Message& m)+0x8e
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam)+0x25

Re: Not able to add objects using spy

Posted: Thu Dec 11, 2014 3:09 pm
by krstcs
When posting bugs, please include the following:

1. Version of Ranorex being used.
2. Version of Windows.
3. Technology of SUT.


Could you also try a clean re-install of Ranorex?

1. Uninstall Ranorex from the system.
2. Reboot the system.
3. Reinstall using the Ranorex Installer Executable.

Re: Not able to add objects using spy

Posted: Thu Dec 18, 2014 1:16 pm
by vamsi
Ranorex Version:4.1.4
Windows 7 64 bit machine
Technology : c#

Re: Not able to add objects using spy

Posted: Fri Dec 19, 2014 1:18 pm
by Support Team
Hello vamsi,

Thank you for the information.
The current version of Ranorex is 5.1.2. krstcs already posted a download link. Please update Ranorex and check if the issue still occurs.
Please take a look at the breaking changes before upgrading Ranorex which can be found on the Release Notes paage on our website. I would also recommend making a backup from your solution first.

Regards,
Bernhard