Working with Ranorex objects..

Ask general questions here.
pavanturlapati
Posts: 3
Joined: Sat May 31, 2014 6:09 pm

Working with Ranorex objects..

Post by pavanturlapati » Sat May 31, 2014 6:19 pm

Hi All,
Could you please help me in understanding these questions:

1. Is it possible to export the objects created through the Ranorex tool into any other file format?

2. Is it possible to create an object dynamically?

3. If I have two objects and with automation id as i. Login1 and Login2. In this case is it possible to work on Login2 and Login2 has not yet been added into the repository file.

It will be great help to show some possible insight in explaining these details. Please let me know incase you need any other information.

Thanks in advance.

Pavan Turlapati

sergii
Posts: 30
Joined: Fri Jun 07, 2013 11:07 pm

Re: Working with Ranorex objects..

Post by sergii » Mon Jun 02, 2014 8:00 pm

Problem 3:
for (int i=0;i<rowCount;i++){
    string xpath = repo.CC.Remittances.tableBatchesInfo.AbsolutePath+"//cell[@columnindex='8' and @rowindex='"+i.ToString()+"' and @visible='true']";
    Element el = Host.Local.FindSingle(xpath, 5000);
    if (el.GetAttributeValueText("Text") == "0") {
        el.Click();
    }
}
Code is going through all cells in the table and clicks on the appropriate one if some condition is met (value is zero).
Last edited by Support Team on Mon Jun 02, 2014 8:17 pm, edited 1 time in total.
Reason: Enabled code highlighting

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: Working with Ranorex objects..

Post by mzperix » Tue Jun 03, 2014 10:38 am

Hi sergi,

Problem 2
Yes, use the Find method. See USer guide: http://www.ranorex.com/support/user-gui ... html#c3202

And see the API reference: http://www.ranorex.com/Documentation/Ranorex/

Unfortunately, there are no code examples in API, but the feature request is on. And they are working on it. Althoug I would rather enable the users to contribute with comment to a method :)


Problem 1
Ranorex objects are either xml or plain text files. What format do you want to export? Do you want to export the object so it could be used by other Test Automation tools? In this case, I am afraid there are no built-in solutions. But since the Ranorex files are plain text based, it is possible to write your own procedures for transformations.

Best Regards,
Zoltan

pavanturlapati
Posts: 3
Joined: Sat May 31, 2014 6:09 pm

Re: Working with Ranorex objects..

Post by pavanturlapati » Tue Jun 03, 2014 5:51 pm

Thanks for the replies. I will give a try and update you back incase I am still struck.

My intention of Problem 1 and Problem 2 combined together is that:

I want to try if I can create an object by myself dynamically in the code and by mentioning all the properties of the object.

If I have the possibility of creating this object (i.e no object has really been added into the Ranorex repository file) I can parameterize the values of those properties.

Now, if I have a table of data with the object name and its properties I will just add the operation to it and hence build the test script automatically. (Something like Keyword driven).

Reason for skipping the tool repository is that incase needed, I can have flexibility to change my tool as we are still in the POC phase.


Thanks,
Pavan Turlapati