How to get a row from table (quicktable)

Ranorex Studio, Spy, Recorder, and Driver.
cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Wed Oct 03, 2012 6:47 am

I took a dll from installed application on 32-bit machine.
I get the same error message.
When I'm loading assembly on Visual Studio 2008, it's load correct.
Maybe the problem is that I've installed Ranorex on 64-bit version of OS, and VS2008 on 32-bit?

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Wed Oct 03, 2012 7:49 am

I've installed Ranorex 3.3.2 on 32-bit OS and I've the same problem with importing assembly.
I also installed SharpDevelop 4.2.0 on 32-bit OS and assembly was import correct.
The project Options in SharpDevelop and Ranorex 3.3.2 are the same (attached screen-shots)
You do not have the required permissions to view the files attached to this post.

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

Re: How to get a row from table (quicktable)

Post by Support Team » Wed Oct 03, 2012 12:33 pm

Hi,

Could it be that a different version of the .NET Framework was used to create the dll?
Is the full/extended version of the .Net 4.0 framework installed on your machine or just the client one?
Which .Net version was used to create the dll?

Regards,
Markus
Ranorex Support Team

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Wed Oct 03, 2012 1:03 pm

Dll was created in .NET Framework v2.0.50727
On machine are installed a .net Framework 4.0 Client Profile and Extended

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Thu Oct 04, 2012 11:28 am

Maybe I could send to You a assembly?
You may try to import it.

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

Re: How to get a row from table (quicktable)

Post by Support Team » Thu Oct 04, 2012 3:07 pm

Hi,

Yes, please send the assembly to [email protected].

Regards,,
Markus
Ranorex Support Team

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Fri Oct 05, 2012 9:58 am

Done :)

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

Re: How to get a row from table (quicktable)

Post by Support Team » Fri Oct 05, 2012 2:37 pm

Thanks!

This seems to be a bug with the code completion.
I added it to the internal bug tracking system, it should be fixed in a next version.
Meanwhile you can ignore this message because this doesn't mean that you can't use the assembly, it just imply that the code completion doesn't work.

Regards,
Markus
Ranorex Support Team

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Fri Oct 05, 2012 3:34 pm

I can't use any types of variable or method from this assembly.
I added a using statement:

Code: Select all

using com.pfsoft.proftrading.controls.table.QuickTable;
When I'm start typing QuickTable I don't have any hint:
You do not have the required permissions to view the files attached to this post.

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

Re: How to get a row from table (quicktable)

Post by Support Team » Mon Oct 08, 2012 11:15 am

Hi,
When I'm start typing QuickTable I don't have any hint:
That's correct, therefore I mentioned that the code completion doesn't work. This is a bug on our site and it will be fixed. Nevertheless you can use the dll, you just don't get any hints because of the not working code completion.

Regards,
Markus
Ranorex Support Team

cwirek
Posts: 29
Joined: Mon Jul 02, 2012 4:24 pm

Re: How to get a row from table (quicktable)

Post by cwirek » Mon Oct 08, 2012 1:46 pm

Now I get an error serializing:

Code: Select all

Ranorex.ActionFailedException: Action 'invokeremotely' failed on element '{Unknown:QuickTable}'. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Ranorex.Plugin.WinFormsFlavorElement.InvokeRemotely(RemotelyInvokedDelegate deleg, Object inputData, Duration timeout) at Ranorex.Plugin.WinFormsFlavorElement.InvokeAction(Element element, String name, Object[] args) at Ranorex.Core.Element.InvokeAction(String name, Object[] args) 
I extended my uses-clause:

Code: Select all

using com.pfsoft.proftrading.controls.table.QuickTable;
using com.pfsoft.proftrading.util;
Serializable Output-Data with Type-Definition

Code: Select all

[Serializable]
private class SOutputData
{
   	public string cellName;
   	public string cellDate;
   	public string cellTime;
}
Invoke-Remotely

Code: Select all

[STAThread]
		void checkDate()
		{
			Form form = "/form[@title='Nowy1']/";
			Report.Log(ReportLevel.Info, "Znalezienie okna Obserwowane Instrumenty");
			Ranorex.Control qt = "/form[@controlname='WorkSpaceForm']/element[@controlname='dockSite1']/element/container/element[@controltypename='QuickTable']";
			
			SOutputData[] outputData = (SOutputData[])  qt.InvokeRemotely (delegate(System.Windows.Forms.Control control, object input)
			{
        		// Get Grid Access
        		QuickTable currGrid = (QuickTable) control;
        		List<SOutputData> remoteOutputData = new List<SOutputData>();   
        		// Iterate through Rows and Cells
        		foreach (QuickTableRow currRow in currGrid.RowsArray)
        		{
           			for (int counter = 0; counter < currRow.cells.Count; counter++)
           			{
              			SOutputData data = new SOutputData();
              			// Specify Data-Type of Cell
           				// Save Value DataTypeSpecific
           				
           				string text = currRow.cells[counter].Value.ToString();
           				
           				if (text.Contains("-"))
           				{
           					data.cellDate = text;
           				}           				
           				else if (text.Contains(":"))
           				{
           					data.cellTime = text;
           				}
           				else if (!text.Contains("Index") && !text.Contains("Spot"))
           				{
           					data.cellName = text;
           				}
              			
              			remoteOutputData.Add(data); // AddToList
           			}
           		}
        	
        		return remoteOutputData.ToArray(); // Return Data
			});
			
			foreach (SOutputData MyOutPut in outputData)
			{
				switch (MyOutPut.cellName)
				{
					case "GER30":
						AtPROD.instance.goldText = MyOutPut.cellName;
						AtPROD.instance.goldDateTime = MyOutPut.cellDate + " " + MyOutPut.cellTime; 
						break;
					case "EUR/USD":
						AtPROD.instance.goldText = MyOutPut.cellName;
						AtPROD.instance.goldDateTime = MyOutPut.cellDate + " " + MyOutPut.cellTime; 
						break;
					default:
						break;
				}
			}

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

Re: How to get a row from table (quicktable)

Post by Support Team » Tue Oct 09, 2012 3:44 pm

Hi,

It seems that anyone of your objects have not been initialized were not set to an instance of an object.
It is very hard for us to find the error without knowledge of your sources, so could you send us a small sample application which includes that control and some test data and all files which are needed in order to run this code?
This would help us solving the issue.
You can also send it to [email protected].

Regards,
Markus
Ranorex Support Team