1

I want to use an existing app session while run my Appium test. So is there any way or Capabilities which i need to add in my code so it can continue the existing app session.

I work around to find a solution over the internet unfortunately I'm not able to find it.

NarendraR
  • 6,770
  • 7
  • 35
  • 69
  • Simply don't use driver close/quit after your test. You can use session as static var – Chandrashekhar Swami May 11 '18 at 06:52
  • @ShekharSwami, my context is, if i'm using an app manually in the device (there is have login manually in the app ) and i want to use that app while opening using through automation.(this time session should be same as i was using manually) – NarendraR May 11 '18 at 06:55
  • I think this depends on your test runner. As long as you don't close the Appium session between test cases, you can continue to work within it. That said, the Appium python client does not, itself, facilitate this.- found on internet – bhupathi turaga May 11 '18 at 07:39
  • @bhupathituraga, I got the solution and posted the same – NarendraR May 14 '18 at 07:11
  • 1
    @NarendraR cool – bhupathi turaga May 14 '18 at 08:45

2 Answers2

4

I got the solution regarding what i intend to do. I've added below capability in my code :

capabilities.setCapability("noReset", true);

Now I'm able to carry the existing session.

e.g. Manually I've opened flipkart app and added one item in cart and closed the app. Now if I'm opening the app using Appium. Now I'm able to see that already added item in the cart.

NarendraR
  • 6,770
  • 7
  • 35
  • 69
0

Step1: Get the SessionId from the appium Logs that you Ran Last time.

Step2: Go to "Connect to Session" on appium

Step3: Enter the SessionId here and click Start Session". But this will is to open the UIAutomator viewer at the screen which is open in screen not for running the script.

Note: The session you ran last should not end in the device.