Is possible to write code without Object repository

Ranorex Spy, Recorder, and Studio.
NewLearner
Posts: 29
Joined: Wed Jan 15, 2014 3:32 pm

Is possible to write code without Object repository

Post by NewLearner » Tue Jan 28, 2014 2:24 pm

Hi,
I'm planning to give the object property name in the runtime(without object repository), is there any way to give the ranorex xpath property value to ranorex in the runtime, like descriptive programming in QTP
If so please give example syntax

Thank you,
Madhavan

User avatar
rprehm
Posts: 24
Joined: Tue Dec 17, 2013 6:43 pm

Re: Is possible to write code without Object repository

Post by rprehm » Fri Jan 31, 2014 11:20 am

Hi NewLeaner,

I’m afraid that I’m not exactly sure what you want to achieve and we do not have much experience with QTP but of course you can access every available property within the RxPath.
E.g.:

QTP descriptive programming:

Code: Select all

Browser("title:=Google").Page("title:=Google").Link("text:= Search").Click
Is similar to this:

Code: Select all

ButtonTag b = "/dom[@domain='www.google.at']//button[#'gbqfba']";
b.Click();
As you can see, the values of the properties are part of the RxPath. In my small example the “@domain” describes the property and ‘www.google.at’ the value. Which is pretty similar to the QTP sample. You are able to extend the RxPath with every available property for that specific Ranorex element.

E.g.: Expand the button with a few properties

Code: Select all

button[@text=null() and @pressed='False' and @name='btnK' and @autofocus='False' and @value='']
As the RxPath is a string you are able to define variables for each value or property:

Code: Select all

string a = "www.google.at";
        	
 ButtonTag b = "/dom[@domain='"+a+"']//button[#'gbqfba']";
Regards,
Robert

NewLearner
Posts: 29
Joined: Wed Jan 15, 2014 3:32 pm

Re: Is possible to write code without Object repository

Post by NewLearner » Wed Feb 12, 2014 10:30 am

Thank you for your reply, this what I'm expecting bcoz I'm planned to do keyword drive...
Since I'm new to Ranorex I'm not aware much commands/methods, where to read/find available commands of Ranorex like "ButtonTag", etc...

Swisside
Posts: 92
Joined: Thu Oct 10, 2013 10:40 am

Re: Is possible to write code without Object repository

Post by Swisside » Fri Feb 14, 2014 8:11 am

Hello.

All the information you need is available online here : http://www.ranorex.com/Documentation/Ranorex/ or directly in Ranorex under Help -> API Documentation.

I was in your state few months ago, if you have any question I'd be happy to help.


Regards


Swiss
A simple thank you always does wonders !