简体   繁体   English

Selenium IDE 给出 SyntaxError: JSON.parse: bad control character in string literal

[英]Selenium IDE gives SyntaxError: JSON.parse: bad control character in string literal

I installed Selenium IDE 2.9.1.我安装了 Selenium IDE 2.9.1。 After starting Selenium IDE and pressing File/Resent test cases I receive an error message:启动 Selenium IDE 并按 File/Resent test cases 后,我收到一条错误消息:

There was an unexpected error.出现意外错误。 Msg: TypeError: this.app is undefined Url: chrome://selenium-ide/content/editor.js, line: 1013, column: 7 Editor.prototype.populateFormatsPopup@chrome://selenium-ide/content/editor.js:1013:7 onpopupshowing@chrome://selenium-ide/content/selenium-ide-sidebar.xul:1:1 Msg: TypeError: this.app is undefined Url: chrome://selenium-ide/content/editor.js, line: 1013, column: 7 Editor.prototype.populateFormatsPopup@chrome://selenium-ide/content/editor。 js:1013:7 onpopupshowing@chrome://selenium-ide/content/selenium-ide-sidebar.xul:1:1

Also when I open Selenium IDE I receive an error message:此外,当我打开 Selenium IDE 时,我收到一条错误消息:

There was an unexpected error.出现意外错误。 Msg: SyntaxError: JSON.parse: bad control character in string literal at line 1 column 1905 of the JSON data Url: chrome://selenium-ide/content/plugin.js, line: 17, column: 22 PluginManager.prototype.load@chrome://selenium-ide/content/plugin.js:17:22 PluginManager@chrome://selenium-ide/content/plugin.js:7:3 Application@chrome://selenium-ide/content/application.js:26:26 Editor@chrome://selenium-ide/content/editor.js:30:14 SidebarEditor@chrome://selenium-ide/content/sidebar-editor.js:22:5 onload@chrome://selenium-ide/content/selenium-ide-sidebar.xul:1:1消息:SyntaxError:JSON.parse:JSON 数据 Url:chrome://selenium-ide/content/plugin.js,第 17 行,第 22 列 PluginManager.prototype 第 1 行第 1905 列的字符串文字中的错误控制字符。 load@chrome://selenium-ide/content/plugin.js:17:22 PluginManager@chrome://selenium-ide/content/plugin.js:7:3 Application@chrome://selenium-ide/content/ application.js:26:26 Editor@chrome://selenium-ide/content/editor.js:30:14 SidebarEditor@chrome://selenium-ide/content/sidebar-editor.js:22:5 onload@chrome ://selenium-ide/content/selenium-ide-sidebar.xul:1:1

System:系统:

  • Firefox: 43 Language Hungarian Firefox:43 种语言匈牙利语
  • Selenium IDE 2.9.1硒 IDE 2.9.1
  • Windows 10*视窗 10*

I already removed and reinstalled selenium plugin from here:我已经从这里删除并重新安装了 selenium 插件:

https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/https://addons.mozilla.org/en-US/firefox/addon/selenium-ide/

Also I removed other FF plugins.我还删除了其他 FF 插件。

Any idea how to solve this problem?知道如何解决这个问题吗? As actually I can not use Selenium in FF...实际上我不能在 FF 中使用 Selenium ......

Seems like an issue with Selenium IDE: https://code.google.com/p/selenium/issues/detail?id=8103似乎是 Selenium IDE 的问题: https : //code.google.com/p/selenium/issues/detail? id =8103

Suggested solution is as follows:建议的解决方案如下:

  1. Type "about:config" in the address bar of Mozilla Firefox.在 Mozilla Firefox 的地址栏中输入“about:config”。
  2. Change the settings to "default" for extensions.javaformatters@seleniumhq.org.install-event-fired and extensions.selenium-ide.pluginsData.将 extensions.javaformatters@seleniumhq.org.install-event-fired 和 extensions.selenium-ide.pluginsData 的设置更改为“默认”。
  3. Close and Now launch the IDE again.关闭然后再次启动 IDE。

Perhaps you are experiencing this because of a conflict with a JavaScript framework, such as mootools.也许您遇到这种情况是因为与 JavaScript 框架(例如 mootools)发生冲突。

In my case,就我而言,

  1. executeScript on document.title = 'Hello World';在 document.title = 'Hello World' 上执行脚本;
    • initally works最初有效
  2. I load a web page using an old copy of mootools我使用旧版 mootools 加载网页
  3. executeScript on document.title = 'Hello World';在 document.title = 'Hello World' 上执行脚本;
    • no longer works with the error message "Failed: HH:MM:SS JSON.parse is not a function"不再处理错误消息“失败:HH:MM:SS JSON.parse is not a function”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM