Ask a Question

Test Run in a suite

SOLVED
hacka87
Contributor

Test Run in a suite

Hello !

 

I have an issue regarding running multiple tests in a suite.

We use XamarinForms Version 3.3

 

I know that Test Complete for instrumenting the application requires a maximum of 2.5.

Do you know if other higher versions of XamarinForms will be supported by Test Complete.

 

We manage to run tests in small groups.

If I run the entire test suite , the tests are hanging, and do not get the proper results.

 

Do you know how to fix some stability issues regarding the test suite.

i believe there is an issue on how the app is closed before each test. It remains in the background.

I have tried with TestedApps.Close() and TestedApps.TerminateAll(). if I access the specific Proces I do not have access to methods as Close. I use the Press Back until the application is minimized in the background.

 

Best Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
AlexKaras
Community Hero

Re: Test Run in a suite

Hi,

 

> Do you know if other higher versions of XamarinForms will be supported by Test Complete.

Yes, I believe in this.

 

> i believe there is an issue on how the app is closed before each test.

Are you testing iOS or Android app?

I think that in the former case you are out of luck.

In the latter case you may add code that will kill tested app process. Like described here: https://stackoverflow.com/questions/3117095/stopping-an-android-app-from-console, https://stackoverflow.com/questions/17829606/android-adb-stop-application-command-like-force-stop-fo....

E.g.:

Mobile.Device().ShellExecute("am kill <com.your.package>");

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

8 REPLIES 8
AlexKaras
Community Hero

Re: Test Run in a suite

Hi,

 

> Do you know if other higher versions of XamarinForms will be supported by Test Complete.

Yes, I believe in this.

 

> i believe there is an issue on how the app is closed before each test.

Are you testing iOS or Android app?

I think that in the former case you are out of luck.

In the latter case you may add code that will kill tested app process. Like described here: https://stackoverflow.com/questions/3117095/stopping-an-android-app-from-console, https://stackoverflow.com/questions/17829606/android-adb-stop-application-command-like-force-stop-fo....

E.g.:

Mobile.Device().ShellExecute("am kill <com.your.package>");

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

hacka87
Contributor

Re: Test Run in a suite

Are you testing iOS or Android app?

 

Testing on both platforms.

 

For iOS I am using TestedApps.TerminateAll()

AlexKaras
Community Hero

Re: Test Run in a suite

> For iOS I am using TestedApps.TerminateAll()

I am really doubting that this works as you are expecting it to do because, as far as I know, there is no way for the user to terminate the process in iOS. Only OS can do this based on its own logic.

I'll appreciate it if you let me know that I am wrong and provide a description of how the regular, non-rooted user can terminate the process in iOS OS.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
hacka87
Contributor

Re: Test Run in a suite

I used this line of code for Android

Mobile.Device().ShellExecute("am kill com.process.name ");

and the process is still running in the background when pressing HomeButton.

 

Do you know if I am missing something?

I even tried with force-stop.

 

Regards,

AlexKaras
Community Hero

Re: Test Run in a suite

Hi,

 

> "am kill com.process.name "

Just to double-check: is 'com.process.name' a real internal name of your tested application?

Any related messages in the test log?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
hacka87
Contributor

Re: Test Run in a suite

Mobile.Device().ShellExecute("pm clear com.process.name") this works on closing the app from the backgroundand also making a clean application. For the moment I would like only the application to close from the background if it's possible.

 

On the other hand, at the next test run in the suite, the application is displaying the loading screen as it is started all over again. This is good.

 

Mobile.Device().ShellExecute("am kill com.process.name") this just displays in the console The shell command was executed.

 

Mobile.Device().ShellExecute("am force-stop com.process.name") this just displays in the console The shell command was executed.

 

Yes, I used the name of the process of the application.

AlexKaras
Community Hero

Re: Test Run in a suite

@hacka87:

You marked the thread as resolved. Does this mean that 'am kill' works as expected and does what you need or you follow some other approach?

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
hacka87
Contributor

Re: Test Run in a suite

I marked it this way, because it is a good solution for the case that I have.

Yes. At the moment this is the solution I use and it works.

 

Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: