{"id":21368113,"url":"https://github.com/veasion/automation_testing","last_synced_at":"2025-06-29T15:03:19.889Z","repository":{"id":162936415,"uuid":"305566569","full_name":"veasion/automation_testing","owner":"veasion","description":"自动化测试框架（通过 js 脚本执行自动化测试）","archived":false,"fork":false,"pushed_at":"2023-02-18T06:57:51.000Z","size":51464,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-15T13:53:38.027Z","etag":null,"topics":["automation","crawler"],"latest_commit_sha":null,"homepage":"https://veasion.github.io/automationjs-docs/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/veasion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-10-20T02:21:06.000Z","updated_at":"2024-07-07T03:24:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"153ab958-bc88-4e4d-9b0e-0ad097646674","html_url":"https://github.com/veasion/automation_testing","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/veasion/automation_testing","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veasion%2Fautomation_testing","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veasion%2Fautomation_testing/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veasion%2Fautomation_testing/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veasion%2Fautomation_testing/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/veasion","download_url":"https://codeload.github.com/veasion/automation_testing/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/veasion%2Fautomation_testing/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262614458,"owners_count":23337277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","crawler"],"created_at":"2024-11-22T07:22:48.758Z","updated_at":"2025-06-29T15:03:19.852Z","avatar_url":"https://github.com/veasion.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 自动化测试框架\n## 简介\n\nweb 浏览器端自动化测试框架，通过 js 脚本执行自动化测试。\n\n可用于web自动化测试 、爬虫、抢票等各种web端模拟操作。\n\n同时有 chrome 插件支持元素定位。\n\nAPI文档：https://veasion.github.io/automationjs-docs/\n\n\n\n## 自动化测试示例\n\n```js\n// 百度搜索“中国”并打印搜索结果\nopen(\"https://www.baidu.com\");\nsendKeys('id=kw', '中国');\nclick(\"css=input[value='百度一下']\");\nwaitForPageLoaded();\nlet list = findDisplayed('css=div#content_left \u003e div');\nfor (let i in list) {\n    println(list[i].text());\n}\n```\n\n\n\n```js\n// 百度搜索“中国”并进入百度百科\nbaiduSearch('中国');\n// 获取搜索结果\nlet list = findDisplayed('css=div#content_left \u003e div');\n// 变量搜索结果\nfor (let i in list) {\n    let element = list[i].findOne(\"css=h3 \u003e a\");\n    // 判断结果是否为百度百科\n    if (element \u0026\u0026 element.text().endsWith(\"百度百科\")) {\n        // 点击\n        element.click();\n        // 等待页面加载\n        waitForPageLoaded(10);\n        // 切换到新打开的窗口\n        switchToNextWindow();\n        break;\n    }\n}\n\nfunction baiduSearch(str) {\n    open(\"https://www.baidu.com\");\n    sendKeys('id=kw', str);\n    click(\"css=input[value='百度一下']\");\n    waitForPageLoaded(5);\n}\n```\n\n项目打包命令: mvn clean install\n\u003cbr\u003e\n运行可执行jar文件路径: \u003cbr\u003e\n win: ${basedir}/target/automation/run.bat\n \u003cbr\u003e\n mac: ${basedir}/target/automation/run.sh\n\n## 赞助\n\n项目的发展离不开你的支持，请作者喝杯咖啡吧！\n\nps：辣条也行 ☕！\n\n![支付宝](https://veasion.oss-cn-shanghai.aliyuncs.com/alipay.png?x-oss-process=image/resize,m_lfit,h_360,w_360)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveasion%2Fautomation_testing","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fveasion%2Fautomation_testing","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fveasion%2Fautomation_testing/lists"}