Is it possible to get the device name and OS from the mobile phone being tested? I've tried to find this information, but was unsuccessful.
What I'd like to do is query the phone under test what type of phone it is . . Android or iOS. Depending on what the phone OS is depends on what user code I call.
Thanks in advance for any help you can provide!
Obtain mobile device name and os
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Obtain mobile device name and os
Hi lstauffer,
In order to get the device name and the OS version of your mobile device you can use the following lines of code:
Regards,
Markus (S)
In order to get the device name and the OS version of your mobile device you can use the following lines of code:
var devName = repo.RootElement.Self.DeviceName; var OSVers = repo.RootElement.Self.OSVersion;Whereby RootElement is:
Regards,
Markus (S)
Re: Obtain mobile device name and os
Thank you!! That worked beautifully!
Re: Obtain mobile device name and os
Hi Markus,
I need to get exact device name which is provided my manufacturer.
Example: ipad2, ipad3, LG nexus, samsung note 3.
Do you have any suggestion?
I need to get exact device name which is provided my manufacturer.
Example: ipad2, ipad3, LG nexus, samsung note 3.
Do you have any suggestion?
Support Team wrote:Hi lstauffer,
In order to get the device name and the OS version of your mobile device you can use the following lines of code:var devName = repo.RootElement.Self.DeviceName; var OSVers = repo.RootElement.Self.OSVersion;Whereby RootElement is:
Regards,
Markus (S)
- Support Team
- Site Admin
- Posts: 12167
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Graz, Austria
Re: Obtain mobile device name and os
Hi Aravin,
The following code allows you to get the information from your device:
Please find more information about non-ui testing in the following chapters of our User Guide
iOS
Android
Regards,
Markus (S)
The following code allows you to get the information from your device:
var app = repo.iOSApp.Self.As<IosApp>(); var info = app.GetDeviceInfo();The info variable now contains the information which is shown in the screenshot below I assume that 'DeviceSpecifier' is the property you are looking for.
Please find more information about non-ui testing in the following chapters of our User Guide
iOS
Android
Regards,
Markus (S)