question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Web Atom interaction is broken due to KReflectionUtils

See original GitHub issue

During debugging with @rajdeepv we found out that the below code works fine on the version - 1.23.2 but doesn’t work on the latest one. The client code we execute is below:


      el = driver.find_element(get_view)

      method_chain = {
          webviewElement:         el.ref,
          forceJavascriptEnabled: true,
          methodChain:            [
              { name: 'withElement', atom: { name: 'findElement', locator: { using: 'ID', value: 'buy_button' } } },
          ],
      }
      driver.execute_script('mobile: webAtoms', method_chain)

we get an exception:

[HTTP] --> POST /wd/hub/session/62efc837-4b93-49bd-bcea-1023b61fde8a/execute/sync
[HTTP] {"script":"mobile: webAtoms","args":[{"webviewElement":"83a7abf3-c6a8-4f9f-aea6-3bd2d8d25b61","forceJavascriptEnabled":true,"methodChain":[{"name":"withElement","atom":{"name":"findElement","locator":{"using":"ID","value":"buy_button"}}},{"name":"perform","atom":"webClick"}]}]}
[debug] [W3C (62efc837)] Calling AppiumDriver.execute() with args: ["mobile: webAtoms",[{"webviewElement":"83a7abf3-c6a8-4f9f-aea6-3bd2d8d25b61","forceJavascriptEnabled":true,"methodChain":[{"name":"withElement","atom":{"name":"findElement","locator":{"using":"ID","value":"buy_button"}}},{"name":"perform","atom":"webClick"}]}],"62efc837-4b93-49bd-bcea-1023b61fde8a"]
[AndroidDriver] Executing native command 'mobile: webAtoms'
[debug] [WD Proxy] Proxying [POST /appium/execute_mobile/web_atoms] to [POST http://127.0.0.1:52796/session/98101eba-e566-4bc0-b3b4-382c0c3468ac/appium/execute_mobile/web_atoms] with body: {"webviewElement":"83a7abf3-c6a8-4f9f-aea6-3bd2d8d25b61","forceJavascriptEnabled":true,"methodChain":[{"name":"withElement","atom":{"name":"findElement","locator":{"using":"ID","value":"buy_button"}}},{"name":"perform","atom":"webClick"}]}
[WD Proxy] Got response with status 500: {"id":"a758392b-9e81-452d-825c-ba16003a0a3b","sessionId":"98101eba-e566-4bc0-b3b4-382c0c3468ac","value":{"error":"unknown error","message":"java.lang.ExceptionInInitializerError","stacktrace":"java.lang.ExceptionInInitializerError\n\tat kotlin.reflect.jvm.internal.impl.builtins.DefaultBuiltIns.getInstance(Unknown Source:0)\n\tat kotlin.reflect.jvm.internal.impl.types.ErrorUtils$1.getBuiltIns(ErrorUtils.java:139)\n\tat kotlin.reflect.jvm.internal.impl.resolve.descriptorUtil.DescriptorUtilsKt.getBuiltIns(DescriptorUtils.kt:167)\n\tat kotlin.reflect.jvm.internal.impl.descriptors.impl.TypeParameterDescriptorImpl.createWithDefaultBound(TypeParameterDescriptorImpl.java:56)\n\tat kotlin.reflect.jvm.internal.impl.builtins.SuspendFunctionTypesKt.<clinit>(suspendFunctionTypes.kt:33)\n\tat kotlin.reflect.jvm.internal.impl.builtins.SuspendFunctionTypesKt.isContinuation(suspendFunctionTypes.kt:82)\n\tat kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.createSuspendView(LazyJavaClassM...
[debug] [W3C] Matched W3C error code 'unknown error' to UnknownError
[debug] [W3C (62efc837)] Encountered internal error running command: An unknown server-side error occurred while processing the command. Original error: java.lang.ExceptionInInitializerError
[debug] [W3C (62efc837)] java.lang.ExceptionInInitializerError
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.DefaultBuiltIns.getInstance(Unknown Source:0)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.types.ErrorUtils$1.getBuiltIns(ErrorUtils.java:139)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.resolve.descriptorUtil.DescriptorUtilsKt.getBuiltIns(DescriptorUtils.kt:167)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.descriptors.impl.TypeParameterDescriptorImpl.createWithDefaultBound(TypeParameterDescriptorImpl.java:56)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.SuspendFunctionTypesKt.<clinit>(suspendFunctionTypes.kt:33)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.SuspendFunctionTypesKt.isContinuation(suspendFunctionTypes.kt:82)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.createSuspendView(LazyJavaClassMemberScope.kt:176)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.doesOverrideSuspendFunction(LazyJavaClassMemberScope.kt:167)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.isVisibleAsFunctionInCurrentClass(LazyJavaClassMemberScope.kt:121)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.computeNonDeclaredFunctions(LazyJavaClassMemberScope.kt:276)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope$functions$1.invoke(LazyJavaScope.kt:121)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope$functions$1.invoke(LazyJavaScope.kt:59)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$MapBasedMemoizedFunction.invoke(LockBasedStorageManager.java:512)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$MapBasedMemoizedFunctionToNotNull.invoke(LockBasedStorageManager.java:587)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope.getContributedFunctions(LazyJavaScope.kt:267)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaClassMemberScope.getContributedFunctions(LazyJavaClassMemberScope.kt:747)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope.computeDescriptors(LazyJavaScope.kt:363)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope$allDescriptors$1.invoke(LazyJavaScope.kt:68)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope$allDescriptors$1.invoke(LazyJavaScope.kt:59)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedLazyValue.invoke(LockBasedStorageManager.java:355)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.storage.LockBasedStorageManager$LockBasedNotNullLazyValue.invoke(LockBasedStorageManager.java:474)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.load.java.lazy.descriptors.LazyJavaScope.getContributedDescriptors(LazyJavaScope.kt:342)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.resolve.scopes.ResolutionScope$DefaultImpls.getContributedDescriptors$default(ResolutionScope.kt:52)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KDeclarationContainerImpl.getMembers(KDeclarationContainerImpl.kt:65)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$declaredNonStaticMembers$2.invoke(KClassImpl.kt:159)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$declaredNonStaticMembers$2.invoke(KClassImpl.kt:44)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data.getDeclaredNonStaticMembers(Unknown Source:8)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$allNonStaticMembers$2.invoke(KClassImpl.kt:168)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$allNonStaticMembers$2.invoke(KClassImpl.kt:44)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data.getAllNonStaticMembers(Unknown Source:8)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$allMembers$2.invoke(KClassImpl.kt:174)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data$allMembers$2.invoke(KClassImpl.kt:44)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl$Data.getAllMembers(Unknown Source:8)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.KClassImpl.getMembers(KClassImpl.kt:192)
[debug] [W3C (62efc837)] 	at kotlin.reflect.full.KClasses.getFunctions(KClasses.kt:90)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.helpers.KReflectionUtils.invokeMethod(KReflectionUtils.kt:87)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.handlers.WebAtoms.handleInternal(WebAtoms.kt:53)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.handlers.WebAtoms.handleInternal(WebAtoms.kt:31)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.handlers.RequestHandler$DefaultImpls.handle(RequestHandler.kt:28)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.handlers.WebAtoms.handle(WebAtoms.kt:31)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.handlers.WebAtoms.handle(WebAtoms.kt:31)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.http.Router.route(Router.kt:222)
[debug] [W3C (62efc837)] 	at io.appium.espressoserver.lib.http.Server.serve(Server.kt:49)
[debug] [W3C (62efc837)] 	at fi.iki.elonen.NanoHTTPD$HTTPSession.execute(NanoHTTPD.java:945)
[debug] [W3C (62efc837)] 	at fi.iki.elonen.NanoHTTPD$ClientHandler.run(NanoHTTPD.java:192)
[debug] [W3C (62efc837)] 	at java.lang.Thread.run(Thread.java:764)
[debug] [W3C (62efc837)] Caused by: java.lang.IllegalStateException: No BuiltInsLoader implementation was found. Please ensure that the META-INF/services/ is not stripped from your application and that the Java virtual machine is not running under a security manager
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader$Companion$Instance$2.invoke(BuiltInsLoader.kt:40)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader$Companion$Instance$2.invoke(BuiltInsLoader.kt:37)
[debug] [W3C (62efc837)] 	at kotlin.SafePublicationLazyImpl.getValue(LazyJVM.kt:107)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader$Companion.getInstance(Unknown Source:2)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.KotlinBuiltIns.createBuiltInsModule(KotlinBuiltIns.java:125)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.DefaultBuiltIns.<init>(DefaultBuiltIns.kt:24)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.DefaultBuiltIns.<init>(DefaultBuiltIns.kt:21)
[debug] [W3C (62efc837)] 	at kotlin.reflect.jvm.internal.impl.builtins.DefaultBuiltIns.<clinit>(DefaultBuiltIns.kt:31)
[debug] [W3C (62efc837)] 	... 52 more
[debug] [W3C (62efc837)]
[HTTP] <-- POST /wd/hub/session/62efc837-4b93-49bd-bcea-1023b61fde8a/execute/sync 500 392 ms - 6737
[HTTP]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
KazuCocoacommented, Nov 19, 2020

You can try this out with Appium 1.19.0

0reactions
KazuCocoacommented, Sep 26, 2020

Could you try out espresso driver v1.35.1? @rajdeepv @PochtarIvan (Available via appium@beta)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Van Der Waals Interactions
Van der Waals forces are driven by induced electrical interactions between two or more atoms or molecules that are very close to each...
Read more >
Atom-Light Interactions
Course Outline. Here I have broken down the course content into seven sections, roughly corresponding to the lectures. Towards the end of the...
Read more >
Emergence of multi-body interactions in few-atom sites of a ...
These interactions cannot be broken down into sums over the underlying pairwise interactions. We measure particle-number-dependent frequency ...
Read more >
Atom–atom interactions around the band edge of a photonic ...
Published online 2016 Aug 31. doi: 10.1073/pnas.1603788113 ... Because of the strong dissipative interactions between the atoms and with J1D ≈ 0, ...
Read more >
Local phase shift due to interactions in an atom interferometer
Abstract. We study the phase shift induced by atomic interactions at the output of an atom interferometer. Due to the mutual interaction between ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found