I am using Android simulator, Appium 1.3.4.1, on Windows 8 and using Javascript with Selenium 2.
I have a session for one app with the capabilities and the test works fine. But now i want to test 2 apps in one session and same emulator sequentially. How can I do this?? How to close one and open the other?
This is my script:
caps1 = {
platformName: "ANDROID",
platformVersion: "4.4",
deviceName: "emulator-5554",
app: "/Users/adt-bundle-windows/sdk/platform-tools/Ox5-debug.apk"
};
caps2 = {
platformName: "ANDROID",
platformVersion: "4.4",
deviceName: "emulator-5554",
app: "/Users/adt-bundle-windows/sdk/platform-tools/Rx5-debug.apk"
};
init = function*() {
var e, sessions;
mobFarm = yiewd.remote(baseUrl);
try {
console.log('Trying existing session');
sessions = (yield mobFarm.sessions());
if (sessions.length < 1) {
throw new Error();
}
return (yield mobFarm.attach(sessions[0].id));
} catch (_error) {
e = _error;
console.log("Creating a new session");
return (yield mobFarm.init(caps1));
}
try {
console.log('Trying existing session');
sessions = (yield mobFarm.sessions());
if (sessions.length < 1) {
throw new Error();
}
return (yield mobFarm.attach(sessions[0].id));
} catch (_error) {
e = _error;
console.log("Creating a new session");
return (yield mobFarm.init(caps2));
}
};
I am new to this so hopefully I can get some help
Thanks
created
Dec '14
last reply
Oct '18
- 17
replies
- 9.4k
views
- 12
users
- 3
likes
- 1
link