|
55 | 55 | public class DefaultSelendroidDriver implements SelendroidDriver {
|
56 | 56 |
|
57 | 57 | public String initializeSession(JSONObject desiredCapabilities) {
|
58 |
| - if (this.session != null) { |
59 |
| - session.getKnownElements().clear(); |
60 |
| - return session.getSessionId(); |
61 |
| - } |
62 |
| - activeWindowType = WindowType.NATIVE_APP.name(); |
| 58 | + |
63 | 59 | Random random = new Random();
|
64 | 60 | this.session = new Session(desiredCapabilities,
|
65 | 61 | new UUID(random.nextLong(), random.nextLong()).toString());
|
66 |
| - nativeSearchScope = |
67 |
| - new NativeSearchScope(serverInstrumentation, getSession().getKnownElements()); |
68 |
| - |
69 |
| - selendroidNativeDriver = |
70 |
| - new SelendroidNativeDriver(serverInstrumentation, (NativeSearchScope) nativeSearchScope); |
71 |
| - SelendroidLogger.log("new s: " + session.getSessionId()); |
72 |
| - |
73 |
| - nativeExecuteScriptMap.put("invokeMenuActionSync", new InvokeMenuAction(session, |
74 |
| - serverInstrumentation)); |
75 |
| - nativeExecuteScriptMap.put("findRId", new FindRId(serverInstrumentation)); |
76 |
| - nativeExecuteScriptMap.put("getL10nKeyTranslation", new GetL10nKeyTranslation( |
77 |
| - serverInstrumentation)); |
78 |
| - nativeExecuteScriptMap.put("findElementByAndroidTag", |
79 |
| - new FindElementByAndroidTag(session.getKnownElements(), serverInstrumentation, keySender)); |
80 |
| - nativeExecuteScriptMap.put("isElementDisplayedInViewport", new IsElementDisplayedInViewport( |
81 |
| - session.getKnownElements(), serverInstrumentation)); |
82 |
| - |
83 | 62 | return session.getSessionId();
|
84 | 63 | }
|
85 | 64 |
|
|
0 commit comments