Welcome to the new Ranorex Support Portal

Non-UI テスト

モバイル アプリケーションのユーザー インターフェースのテスト自動化に加えて、テクノロジー固有のアクションを呼び出すことで、UI 以外のテストを実行することもできます (⇢ アクションのリスト 参照)。この機能により、デバイス ハードウェア、オペレーティング システムなどに関する情報を取得することができます。

Android での Non-UI テスト

Ranorex Spy でモバイル アプリを右クリックすると、Android デバイスのデバイス情報を直接取得できます。

Get device info of Android test device

モバイル アプリに対する Invoke action を追加することで、アクション テーブルで Non-UI テスト メソッドにアクセスできます。

Invoke non-UI testing methods

コード モジュールからだけでなく、ユーザー コード アクションからも Non-UI テスト メソッドにアクセスできます。

このコードは以下のようになります。

var app = repo.AndroidApp.Self.As();  
// get an AndroidDeviceInfo object holding all available device info  
var info = app.GetDeviceInfo();  
// get a list of SMS from the device  
var sms = app.GetSms();  
// get a list of calls from the device  
var calls = app.GetCalls();  
// report the manufacturer of the device  
Report.Info("Manufacturer: " + info.Manufacturer);  
// report the manufacturer of the device  
Report.Info("SMS: " + sms.ToString());  
// report the manufacturer of the device  
Report.Info("Calls: " + calls.ToString());
Dim app = repo.AndroidApp.Self.[As](Of AndroidApp)()  
' get an AndroidDeviceInfo object holding all available device info  
Dim info = app.GetDeviceInfo()  
' get a list of SMS from the device  
Dim sms = app.GetSms()  
' get a list of calls from the device  
Dim calls = app.GetCalls()  
' report the manufacturer of the device  
Report.Info("Manufacturer: " & info.Manufacturer)  
' report the manufacturer of the device  
Report.Info("SMS: " & sms.ToString())  
' report the manufacturer of the device  
Report.Info("Calls: " & calls.ToString())

参照

コード モジュールおよびユーザー コード アクションについては、⇢ コード モジュール および ⇢ ユーザー コード アクション を参照してください。

iOS での Non-UI テスト

iOS での Non-UI テストをおこなうには、libRxDeviceInfos.a および以下のライブラリをリンクする必要があります。

  • AVFoundation.framework
  • CoreTelephony.framework
  • SystemConfiguration.framework
  • ExternalAccessory.framework

Ranorex Spy でモバイル デバイスを右クリックすることで、iOS デバイスに関するデバイス情報を直接取得できます。

Get device info on an iOS test device

テスト実行中のデバイス情報には、ユーザー コード アクションおよびコード モジュールからアクセスできます。

このコードは以下のようになります。

var app = repo.iOSApp.Self.As();  
// get an iOSDeviceInfo object holding all available device info  
var info = app.GetDeviceInfo();  
// Report e.g. the IP address of the device  
Report.Info("IP address: " + info.IpAddress);
Dim app = repo.iOSApp.Self.[As](Of IosApp)()  
' get an iOSDeviceInfo object holding all available device info  
Dim info = app.GetDeviceInfo()  
' Report e.g. the IP address of the device  
Report.Info("IP address: " & Convert.ToString(info.IpAddress))

参照

コード モジュールおよびユーザー コード アクションについては、Ranorex Studio エキスパート > ⇢ コード モジュール および Ranorex Studio 基礎 > ⇢ ユーザー コード アクション を参照してください。