【问题标题】:Unable to click a webelement using selendroid . But Selendroid is able to identify that the Ui Element exists无法使用 selendroid 单击 web 元素。但 Selendroid 能够识别 Ui 元素存在
【发布时间】:2015-11-21 18:49:33
【问题描述】:

Selendroid 无法点击 WebView 中的 UI 元素,但能够识别 Web 元素。

以下是堆栈跟踪。请帮忙。

org.openqa.selenium.WebDriverException: CATCH_ALL:  
java.lang.NumberFormatException: Invalid int: "{"message":"Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: \"default-src 'self'\".\n"}" 
at java.lang.Integer.invalidInt(Integer.java:138) 
at java.lang.Integer.parse(Integer.java:410) 

【问题讨论】:

  • 原生视图运行良好。但仅在服务器最近更改后的 Web 视图中可见。在早期的构建中,相同的操作会起作用

标签: selenium selenium-webdriver appium selendroid


【解决方案1】:

如果将“unsafe-eval”添加到 .html 文件的 Content-security-Policy 标头,则可以与元素交互。 这是因为安全设置!

【讨论】:

  • 这个回复应该是评论,因为它不是他们问题的实际答案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2018-03-15
  • 2020-01-25
  • 1970-01-01
相关资源
最近更新 更多