Can't use an element repository in studio?

Ranorex Spy, Recorder, and Studio.
alimax
Posts: 2
Joined: Tue Apr 17, 2012 7:32 am

Can't use an element repository in studio?

Post by alimax » Tue Apr 17, 2012 7:42 am

Hi,

With Ranorex Spy I create an element repository and save it.
Then I put it in my project and want to use it like that:

Code: Select all

namespace IFM_GUI_Tests.Framework.TestSuites
{
	
	[TestFixture]
	public class RandomClickTest : TestSuiteBase
	{
		Recording1Repository msRepo = Recording1Repository.Instance();
But I always get this error:
Non-invocable member 'IFM_GUI_Tests.Recording1Repository.Instance' cannot be used like a method. (CS1955)
The name of the repo is IFM_GUI_TestsRepository.rxrep and this file includes the IFM_GUI_TestsRepository.cs file.

Can you tell me what I do wrong here? I do the same like in the tutorial.
My Ranorex version is 2.3.3

greets max

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Can't use an element repository in studio?

Post by Support Team » Tue Apr 17, 2012 10:21 am

Hi,
alimax wrote:Non-invocable member 'IFM_GUI_Tests.Recording1Repository.Instance' cannot be used like a method. (CS1955)
You can't use Instance as a method, as the error message already says. Just remove the brackets from instance and it should work like a charm.
Recording1Repository msRepo = Recording1Repository.Instance;
Regards,
Peter
Ranorex Team
.
Image

alimax
Posts: 2
Joined: Tue Apr 17, 2012 7:32 am

Re: Can't use an element repository in studio?

Post by alimax » Tue Apr 17, 2012 12:11 pm

Thank you, did the trick!