How to get the iOS-Version of my testdevice

Mobile Testing, Android App Testing.
JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

How to get the iOS-Version of my testdevice

Post by JToelstede » Fri Nov 15, 2013 9:43 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Mon Nov 18, 2013 5:10 pm

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

JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

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

Post by JToelstede » Tue Nov 19, 2013 8:24 am

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
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Wed Nov 20, 2013 5:47 pm

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

JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

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

Post by JToelstede » Fri Nov 22, 2013 8:24 am

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
You do not have the required permissions to view the files attached to this post.

JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

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

Post by JToelstede » Thu Nov 28, 2013 8:59 am

Hi together,

are there any news to this topic?

Regards,
Joerg

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Thu Nov 28, 2013 11:19 am

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

JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

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

Post by JToelstede » Thu Nov 28, 2013 1:41 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Mon Dec 02, 2013 3:17 pm

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

JToelstede
Posts: 55
Joined: Fri May 24, 2013 12:57 pm

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

Post by JToelstede » Mon Dec 02, 2013 3:29 pm

Hi Bernard,

thanks for the info.

Best regards,
Joerg

chethshetty
Posts: 13
Joined: Wed Apr 09, 2014 5:18 pm

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

Post by chethshetty » Wed Apr 23, 2014 6:22 am

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?

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

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

Post by krstcs » Wed Apr 23, 2014 1:35 pm

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.
Shortcuts usually aren't...