简体   繁体   English

从Selenium IDE将测试导出为python

[英]Export test as python from Selenium IDE

I made several tests in Selenium IDE and saved it as a test suite in the HTML format which works fine for importing back into selenium IDE. 我在Selenium IDE中进行了一些测试,并将其保存为HTML格式的测试套件,可以很好地导入回Selenium IDE。 Now however I would like to expand these tests using python and when I click export test suite and choose python I get this error 但是现在我想使用python扩展这些测试,当我单击“导出测试套件”并选择python时,出现此错误

Suite export not implemented for the chrome://selenium-ide/content/formats/python-rc formatter 未针对chrome:// selenium-ide / content / formats / python-rc格式化程序实施套件导出

How can I enable this option in selenium IDE? 如何在Selenium IDE中启用此选项?

Note I also have found an additional plugin for Firefox that allows batch conversion of tests but still does not allow export of the entire test suite as one file. 注意,我还发现了Firefox的另一个插件,该插件允许测试的批量转换,但仍然不允许将整个测试套件导出为一个文件。 I realize I could combine these files by hand but in the future I would like to have this option in my workflow. 我知道我可以手工组合这些文件,但将来我希望在工作流程中使用此选项。

Thank you. 谢谢。

ps Running Firefox 3.6 on fedora 14 ps在fedora 14上运行Firefox 3.6

What version of SIDE are you running? 您正在运行什么版本的SIDE? If you are running the latest version (1.9), go into options, check the box off for "Enable Experimental Features" and the formats menu should now list Python. 如果您运行的是最新版本(1.9),请进入选项,选中“启用实验性功能”框,然后格式菜单现在应列出Python。

You'll have to download the right plugins and formatters which are available at: http://docs.seleniumhq.org/download/#side_plugins 您必须下载正确的插件和格式化程序,这些插件和格式化程序可在以下位置获得: http : //docs.seleniumhq.org/download/#side_plugins

You also may require to enable 'experimental features' and 'developer tools' in General Options. 您可能还需要在“常规选项”中启用“实验功能”和“开发人员工具”。

Then you should be able to change the format to Python. 然后,您应该能够将格式更改为Python。 See below: 见下文: 屏幕截图1屏幕截图2

Please read also Selenium FAQ and follow the official blog for new changes. 请同时阅读Selenium常见问题解答,并关注官方博客进行新更改。

Also check Selenium with Python for the coding examples. 还要检查Selenium with Python以获取编码示例。


Workaround with the latest versions 最新版本的解决方法

The community of Perl, PHP and Groovy users that use Selenium must have felt sad when the official support for these formatters was dropped. 当放弃对这些格式化程序的官方支持时,使用Selenium的Perl,PHP和Groovy用户社区一定感到很难过。 Starting v1.2.0 of Selenium IDE, these formatters were no longer bundled with Selenium IDE. 从Selenium IDE v1.2.0开始,这些格式化程序不再与Selenium IDE捆绑在一起。 I have some good news for you. 我有个好消息要给你。 All these formatters are bundled as individual plugins and you can still get them from Selenium IDE v1.1.0 if you are interested. 所有这些格式化程序都捆绑在一起作为单独的插件,并且您仍然可以从Selenium IDE v1.1.0中获得它们(如果您有兴趣)。 Here is what you need to do. 这是您需要做的。

  1. Download the Selenium IDE v1.1.0 from official Selenium download site here . 此处的Selenium官方下载站点下载Selenium IDE v1.1.0。 Do not install it, the best way is to right click on the link and save link as. 不要安装它,最好的方法是右键单击链接并将链接另存为。
  2. Next, change the extension from .xpi to .zip and uncompress it (or just simply unzip it: unzip file.xpi ). 接下来,将扩展名从.xpi更改为.zip并解压缩(或仅将其unzip file.xpi压缩: unzip file.xpi )。
  3. Open the extracted files one by one in Firefox using the File menu -> Open File… menu item (python-format.xpi, groovy-format.xpi, perl-format.xpi, php-format.xpi, etc). 在Firefox中使用“文件”菜单->“打开文件...”菜单项(python-format.xpi,groovy-format.xpi,perl-format.xpi,php-format.xpi等)一一打开提取的文件。

And you're done. 这样就完成了。

Troubleshooting 故障排除

  • restart your Firefox after installing new plugins, 安装新插件后重新启动Firefox,
  • make sure that all your format plugins are on Add-ons Manager and are enabled, 确保所有格式插件都在加载项管理器上并已启用,
  • if you run into compatibility issues, you can bump up the em:maxVersion in the install.rdf. 如果遇到兼容性问题,则可以在install.rdf中增加em:maxVersion。 See the screenshot for the location. 请参阅屏幕快照以获取位置。 I am planning to release a tool that will do this automatically in the future. 我打算发布一种工具,该工具将来会自动执行。 Till then, search in Google on how to do this if you are having trouble. 到那时,如果遇到问题,请在Google中搜索如何执行此操作。 I have heard that installing the Add-on Compatibility Reporter first can also help. 我听说先安装附加组件兼容性报告程序也会有所帮助。

Source: http://blog.reallysimplethoughts.com/2011/11/01/the-perl-php-and-groovy-formatters-for-selenium-ide/ 资料来源: http : //blog.reallysimplethoughts.com/2011/11/01/the-perl-php-and-groovy-formatters-for-selenium-ide/

I just change from selenium IDE to katalon , for python and other export formatter support. 我只是从selenium IDE更改为katalon ,以支持python和其他导出格式化程序。

After install and try some selenium IDE , I found it is the tool record and export code like python I needed for now. 安装并尝试使用一些Selenium IDE之后 ,我发现它是工具记录并导出了我现在需要的类似python的代码。

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

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