'Android Pre-launch test Crash due to androidx.test.espresso.web.sugar.Web$WebInteraction.doEval execption

It happens when the Robotest tries to load Google Webpages into the Webview of the App. Specifically for Samsung Device SM-G960U1, SDK 8, API Level 26.

Fatal exception java.lang.RuntimeException: java.lang.RuntimeException: Error in evaluationEvaluation: status: 13 value: {message=Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment.} hasMessage: true message: Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment. FATAL EXCEPTION: Thread-6

java.lang.RuntimeException: java.lang.RuntimeException: Error in evaluationEvaluation: status: 13 value: {message=Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment.} hasMessage: true message: Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment. at androidx.test.espresso.web.sugar.Web$WebInteraction$ExceptionPropagator.(Web.java:2) at androidx.test.espresso.web.sugar.Web$WebInteraction.doEval(Web.java:10) at androidx.test.espresso.web.sugar.Web$WebInteraction.perform(Web.java:1) at androidx.test.tools.crawler.platform.hybrid.HybridInteractionController.swipe(HybridInteractionController.java:15) at androidx.test.tools.crawler.platform.ActionExecutor.execute(ActionExecutor.java:45) at androidx.test.tools.crawler.platform.ActionExecutor.performAction(ActionExecutor.java:4) at androidx.test.tools.crawler.platform.RemotePlatform.handlePerformAction(RemotePlatform.java:22) at androidx.test.tools.crawler.platform.RemotePlatform.messageLoop(RemotePlatform.java:59) at androidx.test.tools.crawler.platform.RemotePlatform.lambda$startCrawlAndWaitUntilFinished$0$androidx-test-tools-crawler-platform-RemotePlatform(RemotePlatform.java:1) at androidx.test.tools.crawler.platform.RemotePlatform$$ExternalSyntheticLambda0.run(Unknown Source:6) at java.lang.Thread.run(Thread.java:764) Caused by: java.lang.RuntimeException: Error in evaluationEvaluation: status: 13 value: {message=Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment.} hasMessage: true message: Refused to evaluate a string as JavaScript because this document requires 'Trusted Type' assignment. at androidx.test.espresso.web.model.SimpleAtom.handleBadEvaluation(SimpleAtom.java:1) at androidx.test.espresso.web.model.SimpleAtom.transform(SimpleAtom.java:2) at androidx.test.espresso.web.model.SimpleAtom.transform(SimpleAtom.java:3) at androidx.test.espresso.web.action.AtomAction$3.apply(AtomAction.java:1) at androidx.test.espresso.web.action.AtomAction$3.apply(AtomAction.java:2) at androidx.test.tools.crawler.obfuscated.bj.d.doTransform(AbstractTransformFuture.java:1) at androidx.test.tools.crawler.obfuscated.bj.d.doTransform(AbstractTransformFuture.java:2) at androidx.test.tools.crawler.obfuscated.bj.e.run(AbstractTransformFuture.java:9) at androidx.test.tools.crawler.obfuscated.bj.g.execute(DirectExecutor.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.executeListener(AbstractFuture.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.complete(AbstractFuture.java:11) at androidx.test.tools.crawler.obfuscated.bj.a.set(AbstractFuture.java:2) at androidx.test.tools.crawler.obfuscated.bj.ab.set(SettableFuture.java:1) at androidx.test.espresso.web.action.AtomAction$1.setResult(AtomAction.java:1) at androidx.test.espresso.web.action.AtomAction$2.run(AtomAction.java:1) at androidx.test.tools.crawler.obfuscated.bj.g.execute(DirectExecutor.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.executeListener(AbstractFuture.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.complete(AbstractFuture.java:11) at androidx.test.tools.crawler.obfuscated.bj.a.set(AbstractFuture.java:2) at androidx.test.tools.crawler.obfuscated.bj.d.setResult(AbstractTransformFuture.java:1) at androidx.test.tools.crawler.obfuscated.bj.e.run(AbstractTransformFuture.java:12) at androidx.test.tools.crawler.obfuscated.bj.g.execute(DirectExecutor.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.executeListener(AbstractFuture.java:1) at androidx.test.tools.crawler.obfuscated.bj.a.complete(AbstractFuture.java:11) at androidx.test.tools.crawler.obfuscated.bj.a.set(AbstractFuture.java:2) at androidx.test.espresso.web.action.JavascriptEvaluation$ValueCallbackFuture.onReceiveValue(JavascriptEvaluation.java:1) at lH.onResult(chromium-Monochrome.aab-stable-432418123:1) at gH.run(chromium-Monochrome.aab-stable-432418123:1) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6938) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source