Page 1 of 1

Is possible to write code without Object repository

Posted: Tue Jan 28, 2014 2:24 pm
by NewLearner
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

Re: Is possible to write code without Object repository

Posted: Fri Jan 31, 2014 11:20 am
by rprehm
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

Re: Is possible to write code without Object repository

Posted: Wed Feb 12, 2014 10:30 am
by NewLearner
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...

Re: Is possible to write code without Object repository

Posted: Fri Feb 14, 2014 8:11 am
by Swisside
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