Not able to add objects using spy

Bug reports.
Posts: 14
Joined: Thu Dec 11, 2014 12:17 pm

Not able to add objects using spy

Post by vamsi » Thu Dec 11, 2014 12:22 pm

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.

System.ArgumentException: Parameter is not valid.
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

Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Not able to add objects using spy

Post by krstcs » Thu Dec 11, 2014 3:09 pm

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.
Shortcuts usually aren't...

Posts: 14
Joined: Thu Dec 11, 2014 12:17 pm

Re: Not able to add objects using spy

Post by vamsi » Thu Dec 18, 2014 1:16 pm

Ranorex Version:4.1.4
Windows 7 64 bit machine
Technology : c#

User avatar
Support Team
Site Admin
Site Admin
Posts: 12173
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Not able to add objects using spy

Post by Support Team » Fri Dec 19, 2014 1:18 pm

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.