Page 1 of 1

error messages of GlobalRepository

Posted: Sun May 26, 2013 9:10 am
by yoad
I used in the samples of ranorex and I wrote in my code
using Ranorex.Core.Repository;
GlobalRepositoryrepo=GlobalRepository.Instance;

but i got error messages :
1.The name 'GlobalRepository' does not exist in the current context (CS0103) - C:UsersYoadDocumentsRanorexRanorexStudio Projectstest_for_objectstest_for_objectsRecording1.UserCode.cs:37,34

2.
The type or namespace name 'GlobalRepository' could not be found (are you missing a using directive or an assembly reference?) (CS0246) - C:UsersYoadDocumentsRanorexRanorexStudio Projectstest_for_objectstest_for_objectsRecording1.UserCode.cs:37,10


how I fix error messages?

Re: error messages of GlobalRepository

Posted: Tue May 28, 2013 8:59 am
by Support Team
Hello,

This message means that Ranorex cannot find the class GlobalRepository.
Is there a repository with this name available in your project?
In order to get more information how to use a repository in user code please read the section "Using Repository in Code" in our user guide.

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Thu May 30, 2013 9:55 am
by yoad
hello Bernhard,
I used your code of website
http://www.ranorex.com/support/user-gui ... html#c3196
in the file check.rxrec-->check.cs
and this is not working
also I can't save your code my project why?

tnx
Support Team wrote:Hello,

This message means that Ranorex cannot find the class GlobalRepository.
Is there a repository with this name available in your project?
In order to get more information how to use a repository in user code please read the section "Using Repository in Code" in our user guide.

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Fri May 31, 2013 3:55 pm
by Support Team
Hello,

In order to analyze the issue I would like to take a look at your project.
Can you send the project to [email protected] or can you attach it to your next post.
I think this is the fastest way in order to fix the issue.
Thank you!

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Sat Jun 01, 2013 3:41 pm
by yoad
hello Bernhard
I sent my project here
Regards,
Yoad
Support Team wrote:Hello,

In order to analyze the issue I would like to take a look at your project.
Can you send the project to [email protected] or can you attach it to your next post.
I think this is the fastest way in order to fix the issue.
Thank you!

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Mon Jun 03, 2013 3:27 pm
by Support Team
Hello,

Thank you for the project.
As I supposed, the repository in your project is not the same as you call in your code. Please try the following line in order to create an instance of the repository in your user code module.
test_for_objects.test_for_objectsRepository repo = test_for_objects.test_for_objectsRepository.Instance;
Additionally I have seen that your repository is empty. That means that the following lines will also not work.
repo.MyApp.Self.Activate();
Report.Info(repo.MyApp.Self.Active.ToString());
repo.MyApp.Self.Maximize(); 
.
.
.
In order to get more information how to work with the repository I would suggest to take a look at the section "How to build up and maintain a Repository in Ranorex" in our user guide. There are a lot of videos which will help you to understand how Ranorex works with the repository.

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Wed Jun 05, 2013 4:05 pm
by yoad
it is not working for me
i send you new project with program.cs and codemodule.cs

Re: error messages of GlobalRepository

Posted: Thu Jun 06, 2013 1:38 pm
by Support Team
Hello,

Thank you for your project.
In your project is no repository and no test suite. If you do not have a repository in your project you cannot use it in code.
Why do you want to implement the tests in user code? I think it would be easier to use the record and play approach in order to write tests.
Please read the user guide in order to get more information how to work with Ranorex.
However, I changed your first project and added a repository item using the Microsoft calculator.
I really would suggest to read the user guide from the beginning.
Thank you!

Regards,
Bernhard

Re: error messages of GlobalRepository

Posted: Sun Jul 07, 2013 8:42 am
by yoad
thank you