Ranorex throws an exception while executing Touch() method

Mobile Testing, Android App Testing.
chethshetty
Posts: 13
Joined: Wed Apr 09, 2014 5:18 pm

Ranorex throws an exception while executing Touch() method

Post by chethshetty » Mon Sep 29, 2014 11:13 am

I am sometime getting an exception while executing the Touch() method.

Consider an example:
Consider touching the button called "Logout"


try
{
if(repo.MyApp.Settings.Button_Logout.Visible)
{
repo.MyApp.Settings.Button_Logout.Touch();
Report.Log(ReportLevel.Success,"Logout button is pressed");
}

}
catch
{
Report.Log(ReportLevel.Failure,"App did not find the Logout button");
}

As per the above code, while executing the Logout.Touch() line, Ranorex throws an exception.

Does anyone know what might be causing this issue?

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

Re: Ranorex throws an exception while executing Touch() method

Post by krstcs » Mon Sep 29, 2014 2:11 pm

Please provide more information:

1. What version of Ranorex are you using?
2. What version of Windows are you using?
3. What mobile OS are you testing against?


Please also provide a copy of the exception. We won't be able to help without knowing what the exception says.
Shortcuts usually aren't...

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

Re: Ranorex throws an exception while executing Touch() method

Post by chethshetty » Mon Oct 06, 2014 10:15 am

Hello there,

Please find my comments inline with your queries below.

1. What version of Ranorex are you using?
Ranorex version 5.1.2
2. What version of Windows are you using?
Windows 7.0 Home basic
3. What mobile OS are you testing against?
iPad 2 with iOS 7.1

Exception:
The Execution comes to catch() block once the Touch() statement is executed. The very next statement after touch() do not get executed. The execution control comes to Catch().

This is my code:
try
{
if(repo.MyApp.Settings.Button_Logout.Visible)
{
Report.Log(ReportLevel.info,"Tap the Logout button");
repo.MyApp.Settings.Button_Logout.Touch();
Report.Log(ReportLevel.Success,"Logout button is pressed");
}

}
catch
{
Report.Log(ReportLevel.Failure,"App did not find the Logout button");
}

As per my above code,
there is an statement "repo.MyApp.Settings.Button_Logout.Touch();" inside try block.
This is nothing but tapping on Logout button. So in this case on the App end the Logout button is tapped/pressed, but the very next statement which should have been executed is not getting executed i;e "Report.Log(ReportLevel.Success," Logout button is pressed"); ". The control simply comes to Catch() block i;e "Report.Log(ReportLevel.Failure,"App did not find the Logout button");" this line gets executed.

Overall it says , the Touch() throws exception and Catch() holds that exception in my case.

So my final report would look like:
Info: Tap the Logout button
Failure: App did not find the Logout button

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

Re: Ranorex throws an exception while executing Touch() method

Post by krstcs » Mon Oct 06, 2014 2:36 pm

Thanks for the information.

However, you described the exception, but you did not furnish the actual text of the exception. Please copy and paste the text of the exception's stack-trace here for evaluation. In the report, on the red line, there should be a link that says something like "Show Stacktrace". Click it and copy and paste the text that is displayed.
Shortcuts usually aren't...