0

I was trying to execute an appium test suite i have created, which consists of multiple test files within the suite.

Can anyone please help, i'm unable to execute the second test script after the execution of first script. It restarts the app and starts afresh. I need to start from where it left off in the first script.

I've tried session-override flag, also tried launch_app().

  • Whenever you start a new session with Appium, it restarts your app. My suggestion is to re-use the session instance across your test cases instead of creating a new one each time. – mandelbaum May 17 '17 at 21:57
  • @mandelbaum Thank you for your reply. Yes, Any suggestions on how to re-use the same session instance, without starting a new one? – Karuna Lingham May 18 '17 at 04:47
  • You can create the session globally and then have your tests import that one session. – mandelbaum May 18 '17 at 16:33
  • I'm using an approach where I start the session only once at the beginning of the run using @BeforeClass. Using this approach, all my tests use the same session – Anish Pillai May 19 '17 at 00:35
  • @mandelbaum How do I create an appium session globally and import that session? – Karuna Lingham May 24 '17 at 05:27
  • @AnishPillai Any suggestions how I could implement that using the python bindings? – Karuna Lingham May 24 '17 at 05:27
  • @KarunaLingham, I'm sorry I haven't worked on Python. But the basic logic would be like this - whatever is your starting point, you can define the driver once there. Then with Java Inheritence concept, you can pass that driver reference to all other classes and in this way, all classes would be able to use the same session. – Anish Pillai May 25 '17 at 00:56

2 Answers2

1

If you use the full reset option as false in desired capabilities, then the app won't be started fresh every time. I used the following in my desired capabilities.

capabilities.setCapability("fullReset", false);

If you are using appium 1.5.3 GUI, check the box against No reset in iOS/Android settings.

Padma
  • 117
  • 5
  • Thanks for your answer. But that didn't work for me when I added the above mentioned capability in each test script. Still resets the app and starts afresh. However, when i marked the check box 'no reset' in the GUI, the entire test suite goes in no reset mode, whereas I need the first test script to start with a fullReset and the following scripts with noReset. – Karuna Lingham May 24 '17 at 05:22
  • It didn't work with 'fullReset': 'false' but instead worked with 'noReset': 'true' :D Thank you anyway for your help! – Karuna Lingham May 30 '17 at 11:10
1

You need to add the above capability in the main method where you have mentioned the other capabilities such as device name, app path, .. so that the main method will install the app in your device first and start execute the first test method freshly followed by the other test methods in the suite without reset.I am using this in my automation both in iOS and Android. Uninstall the app if you have already before running the test in the test device.

Padma
  • 117
  • 5