Screen Capture through Variable/Constant in Object Repo

Class library usage, coding and language questions.
dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Screen Capture through Variable/Constant in Object Repo

Post by dal » Thu Oct 07, 2010 8:33 am

Team,

As per the example below, is there a way to access the "AppFolderName" as a String Variable/Constant.
Or we need to explicitely use the AppFolder Name instead of having them in functions?

Code: Select all


Dim Repo As GlobalRepository = GlobalRepository.Instance
Const AppFolderName = "AppFolder1"

Repo.AppFolderName.Self.Focus() 'Pls suggest what might be the change I need to make here...
Report.Screenshot()	


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

Re: Screen Capture through Variable/Constant in Object Repo

Post by Support Team » Thu Oct 07, 2010 2:02 pm

Hi,

Can you please describe this in more detail, because at the moment I don't know exactly what you are trying to do.

Thank in advance.

Regards,
Peter
Ranorex Team
.
Image

dal
Posts: 72
Joined: Thu Jun 24, 2010 8:59 am

Re: Screen Capture through Variable/Constant in Object Repo

Post by dal » Fri Oct 08, 2010 6:29 am

Let's say I have the following Application Folder in my Object Repository.
E.g.
AppFolder1 (for Login)
AppFolder2 (for Home Page)

I want to capture every Application Folder (i.e. Every Distinct Page in my application) through the following method:

repo.AppFolder1.Self.Focus()
Report.ScreenShot()

repo.AppFolder2.Self.Focus()
Report.ScreenShot()

Instead of having the AppFolder1/AppFolder2 ... can I pass through a variable which will intern capture a screen shot for me for the different application folder in my application.

Regards,
Dal...

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

Re: Screen Capture through Variable/Constant in Object Repo

Post by Support Team » Fri Oct 08, 2010 8:42 am

Hi,

Sorry but it is not possible at the moment to make the repository variable. The only way you can check it would be to use reflection. Therefore take a look to following link http://msdn.microsoft.com/en-us/library ... 80%29.aspx

Regards,
Peter
Ranorex Team
.
Image