一些用于将SeleniumLibrary迁移到浏览器的辅助工具
项目描述
robotframework-browser-migration
该项目包含两件事。
一个小脚本,用于分析您未使用的SeleniumLibrary关键字,并统计在您项目中的使用情况。
一个名为SeleniumLibraryToBrowser的迁移层库,它实现了约80%的SeleniumLibrary关键字,由浏览器库实现。
安装
运行
pip安装 robotframework-browser-migration
对于迁移层库,您还需要安装并初始化Robot_Framework_Browser
pip安装 robotframework-browser
并且
rfbrowser init
SeleniumLibraryToBrowser
请在此处的关键字文档中找到已实现的关键字。
使用方法
*** Settings ***
Library SeleniumLibraryToBrowser
*** Test Cases ***
My Test Case
Open Browser https://robocon.io chrome
Location Should Be https://robocon.io/
${hamburger}= Run Keyword And Return Status Element Should Be Visible css:.hamburger
IF ${hamburger} Click Button css:.hamburger
Click Link RBCN22
Location Should Be https://robocon.io/2022
Close All Browsers
请注意,一些关键字将永远不会实现,其他关键字只是基本兼容。例如,强烈建议使用浏览器库的New Browser/New Context/New Page或New Persistent Context来代替Open Browser。
SeleniumStats
我们想了解哪些关键字在我们的社区中大量使用。在第一步,我们希望收集这些信息,以了解浏览器库中缺少哪些关键字。
稍后,我们还将向您展示哪些关键字已经可以通过浏览器库替换,以及如何进行替换。
感谢您的帮助!
它的工作原理
这个小脚本会分析您的output.xml文件,并统计您SeleniumLibrary关键词的使用情况。
它会检查哪些Selenium关键词被使用,以及它们被调用的频率。它还会检查有多少不同的父元素(关键词、测试用例或测试套件)直接调用此关键词。这个“父元素”计数是您在迁移时可能需要更改的地方的数量。
我们绝不会获取您的任何私人或机密数据!我们仅使用您测试和关键词名称的哈希值来汇总它们的出现次数。而且,这些哈希值也绝不会存储在任何文件中。
生成数据/统计信息绝对匿名!
完成时,您将看到所有收集到的数据作为统计表格。
就像这里
+----------------------------------+-------+---------+
| Keyword | count | parents |
+----------------------------------+-------+---------+
| Checkbox Should Be Selected | 10 | 2 |
| Checkbox Should Not Be Selected | 10 | 2 |
| Clear Element Text | 1 | 1 |
| Click Button | 4 | 4 |
| Click Element | 48 | 20 |
| Click Link | 18 | 10 |
| Close All Browsers | 30 | 16 |
| Close Browser | 15 | 8 |
| Element Text Should Be | 18 | 5 |
| Execute Javascript | 18 | 2 |
| Get Element Count | 8 | 1 |
| Get Location | 8 | 2 |
| Get Text | 40 | 9 |
| Get WebElement | 17 | 3 |
| Get WebElements | 10 | 3 |
| Go To | 30 | 19 |
| Input Password | 45 | 19 |
| Input Text | 47 | 21 |
| Location Should Be | 47 | 16 |
| Open Browser | 55 | 29 |
| Page Should Contain Element | 9 | 8 |
| Select Checkbox | 10 | 4 |
| Select From List By Label | 2 | 2 |
| Select From List By Value | 1 | 1 |
| Set Window Position | 2 | 2 |
| Switch Window | 16 | 1 |
| Title Should Be | 30 | 16 |
| Unselect Checkbox | 8 | 4 |
| Wait Until Element Is Visible | 27 | 9 |
| Wait Until Page Contains Element | 4 | 1 |
+----------------------------------+-------+---------+
Statistics File: /Source/robotframework-browser-migration/src/keyword_stats.json
Please upload the file to https://data.keyword-driven.de/index.php/s/SeleniumStats for full anonymity.
IP-Addresses or other personal data are not logged when uploading the file!
You can also mail it to mailto:rene@robotframework.org.
Thanks you very much for your support!
Your Browser-Team (Mikko, Tatu, Kerkko, Janne and René)
与我们分享这些数据的最简单、最匿名的方式是将keyword_stats.json上传到https://data.keyword-driven.de/index.php/s/SeleniumStats。我们不会存储上传者的任何信息。没有IP地址!什么都没有。
使用方法
使用您的output.xml路径作为第一个参数调用SeleniumStats。这个output.xml也可以是从dryrun获得的!
python -m SeleniumStats c:\\MyTests\\output.xml
然后请将keyword_stats.json发送给我们。
非常感谢!!!
浏览器团队
项目详情
哈希值 for robotframework-browser-migration-1.0.0.tar.gz
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 5f07f428c21e2aac112b99d9b40e57c8d049ce03ba943c99ac5ce74079fc3914 |
|
MD5 | 3db32ebe1f3a6592b6e7398cc5e50f7f |
|
BLAKE2b-256 | abca0138c7464657c128aad165849790371b9e302b1fb4e515749f1428105751 |
哈希值 for robotframework_browser_migration-1.0.0-py3-none-any.whl
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b23dbcc93b74011ac6ef3e9347a43f289418d3ce9118d477876d4318ca2f81b3 |
|
MD5 | b3d100c7906b023552a8f219225cc527 |
|
BLAKE2b-256 | 8b74657ab90f8755a1f4924313b40bb1d9a04ce74e6153777d3789fd952caa52 |