Page 1 of 1

How to get the iOS-Version of my testdevice

Posted: Fri Nov 15, 2013 9:43 am
by JToelstede
Hi together,

we want in our test report display the iOS-Version of the used test device.
Is it possible to get the iOS-Version of the test device during runtime and how could I access on it in my usercode?

I have searched for this number on the device with ViewSpy and I found an attribute in my mobile app called OSVersion but the string is "iOS 0.0.0".

Thanks for help.

Kind regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Mon Nov 18, 2013 5:10 pm
by Support Team
Hello Joerg,

Which version of Ranorex is installed on your machine?
This should be possible in our current version.
Is it possible to get the iOS-Version of the test device during runtime and how could I access on it in my usercode?
You can use the "OSVersion" property in order to get the OS-Version at runtime. Please take a look at the online API documentation

Regards,
Bernhard

Re: How to get the iOS-Version of my testdevice

Posted: Tue Nov 19, 2013 8:24 am
by JToelstede
Hello Bernhard,

we use the latest version of Ranorex (4.1.2.16100) with the latest version of the agent in our iOS-app.

I could get the OS-version of Windows, where Ranorex is running ...

Code: Select all

Report.Info("OS-Version: " + Host.Local.OSVersion);
... but I don't know how to get the OS-version of my iOS-test device during runtime and when I look on my test device with ViewSpy I only found 0.0.0 as OSVersion of my mobile device which isn't correct.
iOS-Version.jpg
Regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Wed Nov 20, 2013 5:47 pm
by Support Team
Hello Joerg,

You have to use the MobileApp class as described in the code snippet below, but the main problem is that you don't get the correct version string.
Unfortunately I cannot reproduce the issue. It works properly on our devices. Which kind of device are you using.
var mobileAppRepoElement = repo.YourMobileApp;
MobileApp MyApp = MobileApp(mobileAppRepoElement );
MyApp.OSVersion();
Regards,
Bernhard

Re: How to get the iOS-Version of my testdevice

Posted: Fri Nov 22, 2013 8:24 am
by JToelstede
Hi Bernhard,

thanks for help. We are testing on an iPad and iPhone with iOS7.x.
I now inserted your code but I still don't get the iOS-Version out of my device.
Here the rebuilded code snippet:

Code: Select all

Element mobileAppRepoElement = repo.YourMobileApp.mobileApp.Element;
MobileApp myApp = new MobileApp(mobileAppRepoElement);
Report.Info("OS-Version: " + myApp.OSVersion);
Here the report result:
Report-iOS-Version.jpg
Regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Thu Nov 28, 2013 8:59 am
by JToelstede
Hi together,

are there any news to this topic?

Regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Thu Nov 28, 2013 11:19 am
by Support Team
Hello Joerg,

I have an additional question. Is your device added via WIFI or via USB?
Can you please try to add the device via WIFI and check if the issue also occurs.

Regards,
Bernhard

Re: How to get the iOS-Version of my testdevice

Posted: Thu Nov 28, 2013 1:41 pm
by JToelstede
Hi Bernhard,

I use the device on both ways and I have for each connection a separate device in Ranorex.
I tried both ways again and it doesn't matter on which way the device is connected.
The problem occurs on both ways.
During the test of both ways only one device was active and the other disabled via the "Ranorex Device Manager".

Regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Mon Dec 02, 2013 3:17 pm
by Support Team
Hello Joerg,

Our development team found a bug in Ranorex, which could cause the issue. The bug will be fixed in one of our next releases. Unfortunately there is no workaround at the moment.

Regards,
Bernhard

Re: How to get the iOS-Version of my testdevice

Posted: Mon Dec 02, 2013 3:29 pm
by JToelstede
Hi Bernard,

thanks for the info.

Best regards,
Joerg

Re: How to get the iOS-Version of my testdevice

Posted: Wed Apr 23, 2014 6:22 am
by chethshetty
Element mobileAppRepoElement = repo.YourMobileApp.mobileApp.Element;
MobileApp myApp = new MobileApp(mobileAppRepoElement);
Report.Info("OS-Version: " + myApp.OSVersion);

Can some one suggest what do repo.YourMobileApp.mobileApp.Element; line signifies?

What does YourMobileApp refers to?

Re: How to get the iOS-Version of my testdevice

Posted: Wed Apr 23, 2014 1:35 pm
by krstcs
It is the base repository object for the application under test.

The line you are asking about gets a reference to the actual element in the application under test that is being pointed to by the repo object "mobileApp".

repo -> The instantiated Ranorex Repository.
YourMobileApp -> (Made up name) The name of the root app object in the repo.
mobileApp -> (Made up name) The name of a repo object based under YourMobileApp.