Commit d34b5894 authored by 曹金梅's avatar 曹金梅

小小更新

parent b7df4dfc
# Midscene.js dump files
midscene_run/report
midscene_run/dump
midscene_run/tmp
# Example batch execution index YAML file
# This demonstrates how to use the multi-YAML file batch execution feature
# Concurrency settings (default: 1 for sequential execution)
concurrent: 10
# Continue execution even if one file fails (default: false)
continueOnError: true
# Summary output file
summary: "./midscene_run/output/custom-summary.json"
# Global web environment configuration (applied to all files)
web:
# All individual YAML files will inherit these settings
shareBrowserContext: true
viewportWidth: 1280
viewportHeight: 720
# bridgeMode: "newTabWithUrl"
# Output directory for individual files (will be combined with file-specific paths)
# Global android environment configuration (if needed)
# android:
# deviceId: "emulator-5554"
# Execution order using glob patterns
files:
- "midscene-scripts/extract-github-status.yaml"
- "midscene-scripts/bing-search.yaml"
- "midscene-scripts/local-static-server.yml"
- "midscene-scripts/s*.yaml"
#######################【模型配置】#######################
# 郭阔 OPENAI_API_KEY=sk-7462d1ceb103428d9b999324b11dfc26
OPENAI_BASE_URL="https://dashscope.aliyuncs.com/compatible-mode/v1"
OPENAI_API_KEY=""
MIDSCENE_MODEL_NAME="qwen-vl-max-latest"
MIDSCENE_USE_QWEN_VL=1
midsceneVersion: 0.26.6
cacheId: static-pages
caches:
- type: plan
prompt: 点击 "集微企业库"按钮
yamlWorkflow: |
tasks:
- name: 点击 "集微企业库"按钮
flow:
- aiTap: The '集微企业库' button in the top navigation bar
- type: locate
prompt: The '集微企业库' button in the top navigation bar
xpaths:
- >-
/html/body/div[1]/section[1]/section[1]/section[1]/nav[1]/ul[1]/li[7]/a[normalize-space()="集微企业库"]
[2025-08-22T10:51:49.272+08:00] sending request to qwen-vl-max-latest
[2025-08-22T10:51:56.264+08:00] response: ```json
{
"what_the_user_wants_to_do_next_by_instruction": "点击 '集微企业库' 按钮",
"log": "I will use action Tap to click the '集微企业库' button",
"more_actions_needed_by_instruction": false,
"action": {
"type": "Tap",
"locate": {
"bbox": [1064, 18, 1152, 32],
"prompt": "The '集微企业库' button in the top navigation bar"
}
}
}
```
[2025-08-22T10:52:01.095+08:00] sending request to qwen-vl-max-latest
[2025-08-22T10:52:04.439+08:00] response: ```json
{
"thought": "页面显示正常,包含完整的导航和内容区域,没有出现404错误提示。",
"data": {
"result": true
},
"errors": []
}
```
[2025-08-22T10:52:04.995+08:00] sending request to qwen-vl-max-latest
[2025-08-22T10:52:12.360+08:00] response: ```json
{
"thought": "页面加载正常,无报错信息,内容完整显示。",
"data": {
"result": true
},
"errors": []
}
```
[2025-08-22T10:51:56.264+08:00] model usage detail: {"prompt_tokens":4506,"completion_tokens":128,"total_tokens":4634}
[2025-08-22T10:52:04.439+08:00] model usage detail: {"prompt_tokens":3906,"completion_tokens":49,"total_tokens":3955}
[2025-08-22T10:52:12.360+08:00] model usage detail: {"prompt_tokens":3903,"completion_tokens":43,"total_tokens":3946}
[2025-08-22T10:51:56.263+08:00] model, qwen-vl-max-latest, mode, qwen-vl, ui-tars-version, false, prompt-tokens, 4506, completion-tokens, 128, total-tokens, 4634, cost-ms, 6990, requestId, f99c65e6-d845-96c4-8cfa-f5f6234312c1
[2025-08-22T10:52:04.439+08:00] model, qwen-vl-max-latest, mode, qwen-vl, ui-tars-version, false, prompt-tokens, 3906, completion-tokens, 49, total-tokens, 3955, cost-ms, 3344, requestId, b0a58dc8-898e-9062-9a65-69702797bc56
[2025-08-22T10:52:12.360+08:00] model, qwen-vl-max-latest, mode, qwen-vl, ui-tars-version, false, prompt-tokens, 3903, completion-tokens, 43, total-tokens, 3946, cost-ms, 7364, requestId, f3cf4478-919b-9925-9f14-45f022dcff21
[2025-08-22T10:51:48.181+08:00] no cache file found, path: C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\cache\static-pages.cache.yaml
[2025-08-22T10:51:48.183+08:00] no unused cache found, type: plan, prompt: 点击 "集微企业库"按钮
[2025-08-22T10:51:56.545+08:00] no unused cache found, type: locate, prompt: The '集微企业库' button in the top navigation bar
[2025-08-22T10:51:56.550+08:00] will append cache {
type: 'locate',
prompt: "The '集微企业库' button in the top navigation bar",
xpaths: [
'/html/body/div[1]/section[1]/section[1]/section[1]/nav[1]/ul[1]/li[7]/a[normalize-space()="集微企业库"]'
]
}
[2025-08-22T10:51:56.553+08:00] cache flushed to file: C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\cache\static-pages.cache.yaml
[2025-08-22T10:51:58.876+08:00] will append cache {
type: 'plan',
prompt: '点击 "集微企业库"按钮',
yamlWorkflow: 'tasks:\n' +
' - name: 点击 "集微企业库"按钮\n' +
' flow:\n' +
" - aiTap: The '集微企业库' button in the top navigation bar\n"
}
[2025-08-22T10:51:58.878+08:00] cache flushed to file: C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\cache\static-pages.cache.yaml
[2025-08-22T10:51:48.511+08:00] actionSpace for page is: Tap, RightClick, Hover, Input, KeyboardPress, Scroll
[2025-08-22T10:51:56.649+08:00] executing action Tap undefined context.element.center: 1117,21
[2025-08-22T10:51:40.915+08:00] argv {
_: [ './static-pages.yaml' ],
'$0': 'D:\\nodejs\\node_global\\node_modules\\@midscene\\cli\\bin\\midscene'
}
[2025-08-22T10:51:40.947+08:00] launching browser with viewport, headed false viewport { width: 2580, height: 1320, deviceScaleFactor: 1 } args [
'--disable-features=HttpsFirstBalancedModeAutoEnable',
'--disable-features=PasswordLeakDetection',
'--disable-save-password-bubble',
'--user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"',
'--window-size=2580,1520'
] preference {
headed: false,
keepWindow: false,
testId: 'static-pages',
cacheId: 'static-pages'
}
[2025-08-22T10:51:41.586+08:00] goto https://jiweidev.jiweinet.com/
[2025-08-22T10:51:47.528+08:00] waitForNetworkIdle 2000
[2025-08-22T10:51:48.184+08:00] Getting page URL
[2025-08-22T10:51:48.184+08:00] URL end
[2025-08-22T10:51:48.184+08:00] Uploading test info to server
[2025-08-22T10:51:48.305+08:00] UploadTestInfoToServer end
[2025-08-22T10:51:48.306+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:51:48.407+08:00] GetElementsNodeTree end
[2025-08-22T10:51:48.508+08:00] ScreenshotBase64 end
[2025-08-22T10:51:48.508+08:00] ParseContextFromWebPage end
[2025-08-22T10:51:48.508+08:00] Traversing element tree
[2025-08-22T10:51:48.509+08:00] TraverseTree end
[2025-08-22T10:51:48.510+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:51:56.266+08:00] Getting page URL
[2025-08-22T10:51:56.266+08:00] URL end
[2025-08-22T10:51:56.266+08:00] Uploading test info to server
[2025-08-22T10:51:56.383+08:00] UploadTestInfoToServer end
[2025-08-22T10:51:56.384+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:51:56.456+08:00] GetElementsNodeTree end
[2025-08-22T10:51:56.544+08:00] ScreenshotBase64 end
[2025-08-22T10:51:56.544+08:00] ParseContextFromWebPage end
[2025-08-22T10:51:56.544+08:00] Traversing element tree
[2025-08-22T10:51:56.545+08:00] TraverseTree end
[2025-08-22T10:51:56.545+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:52:00.673+08:00] Getting page URL
[2025-08-22T10:52:00.673+08:00] URL end
[2025-08-22T10:52:00.673+08:00] Uploading test info to server
[2025-08-22T10:52:00.792+08:00] UploadTestInfoToServer end
[2025-08-22T10:52:00.792+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:52:00.805+08:00] GetElementsNodeTree end
[2025-08-22T10:52:00.880+08:00] ScreenshotBase64 end
[2025-08-22T10:52:00.880+08:00] ParseContextFromWebPage end
[2025-08-22T10:52:00.880+08:00] Traversing element tree
[2025-08-22T10:52:00.880+08:00] TraverseTree end
[2025-08-22T10:52:00.880+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:52:00.880+08:00] Getting page URL
[2025-08-22T10:52:00.880+08:00] URL end
[2025-08-22T10:52:00.880+08:00] Uploading test info to server
[2025-08-22T10:52:00.992+08:00] UploadTestInfoToServer end
[2025-08-22T10:52:00.992+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:52:01.016+08:00] GetElementsNodeTree end
[2025-08-22T10:52:01.094+08:00] ScreenshotBase64 end
[2025-08-22T10:52:01.094+08:00] ParseContextFromWebPage end
[2025-08-22T10:52:01.094+08:00] Traversing element tree
[2025-08-22T10:52:01.094+08:00] TraverseTree end
[2025-08-22T10:52:01.094+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:52:04.585+08:00] Getting page URL
[2025-08-22T10:52:04.585+08:00] URL end
[2025-08-22T10:52:04.585+08:00] Uploading test info to server
[2025-08-22T10:52:04.695+08:00] UploadTestInfoToServer end
[2025-08-22T10:52:04.695+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:52:04.702+08:00] GetElementsNodeTree end
[2025-08-22T10:52:04.798+08:00] ScreenshotBase64 end
[2025-08-22T10:52:04.798+08:00] ParseContextFromWebPage end
[2025-08-22T10:52:04.798+08:00] Traversing element tree
[2025-08-22T10:52:04.798+08:00] TraverseTree end
[2025-08-22T10:52:04.798+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:52:04.798+08:00] Getting page URL
[2025-08-22T10:52:04.798+08:00] URL end
[2025-08-22T10:52:04.798+08:00] Uploading test info to server
[2025-08-22T10:52:04.906+08:00] UploadTestInfoToServer end
[2025-08-22T10:52:04.906+08:00] Starting parallel operations: screenshot and element tree
[2025-08-22T10:52:04.914+08:00] GetElementsNodeTree end
[2025-08-22T10:52:04.994+08:00] ScreenshotBase64 end
[2025-08-22T10:52:04.994+08:00] ParseContextFromWebPage end
[2025-08-22T10:52:04.994+08:00] Traversing element tree
[2025-08-22T10:52:04.994+08:00] TraverseTree end
[2025-08-22T10:52:04.994+08:00] size: 2580x1320 dpr: 1
[2025-08-22T10:51:58.936+08:00] writeOutActionDumps C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\report\static-pages-2025-08-22_10-51-48-jrwfbto4.html
[2025-08-22T10:52:04.482+08:00] writeOutActionDumps C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\report\static-pages-2025-08-22_10-51-48-jrwfbto4.html
[2025-08-22T10:52:12.405+08:00] writeOutActionDumps C:\Users\95439\Desktop\test-jiwei-web\jiwei-web\midscene_run\report\static-pages-2025-08-22_10-51-48-jrwfbto4.html
[2025-08-22T10:51:48.306+08:00] waitForNavigation begin
[2025-08-22T10:51:48.306+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:48.308+08:00] waitForNavigation begin
[2025-08-22T10:51:48.308+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:48.323+08:00] waitForNavigation end
[2025-08-22T10:51:48.323+08:00] screenshotBase64 begin
[2025-08-22T10:51:48.324+08:00] waitForNavigation end
[2025-08-22T10:51:48.325+08:00] evaluate function begin
[2025-08-22T10:51:48.407+08:00] evaluate function end
[2025-08-22T10:51:48.407+08:00] getElementsNodeTree end, cost: 82ms
[2025-08-22T10:51:48.508+08:00] screenshotBase64 end, cost: 185ms
[2025-08-22T10:51:48.509+08:00] evaluate function begin
[2025-08-22T10:51:48.510+08:00] evaluate function end
[2025-08-22T10:51:56.384+08:00] waitForNavigation begin
[2025-08-22T10:51:56.384+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:56.384+08:00] waitForNavigation begin
[2025-08-22T10:51:56.384+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:56.389+08:00] waitForNavigation end
[2025-08-22T10:51:56.389+08:00] screenshotBase64 begin
[2025-08-22T10:51:56.389+08:00] waitForNavigation end
[2025-08-22T10:51:56.389+08:00] evaluate function begin
[2025-08-22T10:51:56.456+08:00] evaluate function end
[2025-08-22T10:51:56.456+08:00] getElementsNodeTree end, cost: 67ms
[2025-08-22T10:51:56.544+08:00] screenshotBase64 end, cost: 155ms
[2025-08-22T10:51:56.545+08:00] evaluate function begin
[2025-08-22T10:51:56.550+08:00] evaluate function end
[2025-08-22T10:51:56.553+08:00] waitForNavigation begin
[2025-08-22T10:51:56.553+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:56.557+08:00] waitForNavigation end
[2025-08-22T10:51:56.557+08:00] screenshotBase64 begin
[2025-08-22T10:51:56.649+08:00] screenshotBase64 end, cost: 92ms
[2025-08-22T10:51:56.650+08:00] mouse move to 1117, 21
[2025-08-22T10:51:56.656+08:00] mouse click 1117, 21
[2025-08-22T10:51:58.776+08:00] waitForNavigation begin
[2025-08-22T10:51:58.776+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:58.789+08:00] waitForNavigation end
[2025-08-22T10:51:58.789+08:00] screenshotBase64 begin
[2025-08-22T10:51:58.875+08:00] screenshotBase64 end, cost: 86ms
[2025-08-22T10:51:59.937+08:00] waitForNavigation begin
[2025-08-22T10:51:59.937+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:51:59.944+08:00] waitForNavigation end
[2025-08-22T10:51:59.945+08:00] screenshotBase64 begin
[2025-08-22T10:52:00.673+08:00] screenshotBase64 end, cost: 728ms
[2025-08-22T10:52:00.792+08:00] waitForNavigation begin
[2025-08-22T10:52:00.792+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:00.792+08:00] waitForNavigation begin
[2025-08-22T10:52:00.792+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:00.798+08:00] waitForNavigation end
[2025-08-22T10:52:00.799+08:00] screenshotBase64 begin
[2025-08-22T10:52:00.799+08:00] waitForNavigation end
[2025-08-22T10:52:00.799+08:00] evaluate function begin
[2025-08-22T10:52:00.804+08:00] evaluate function end
[2025-08-22T10:52:00.805+08:00] getElementsNodeTree end, cost: 6ms
[2025-08-22T10:52:00.880+08:00] screenshotBase64 end, cost: 81ms
[2025-08-22T10:52:00.992+08:00] waitForNavigation begin
[2025-08-22T10:52:00.992+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:00.992+08:00] waitForNavigation begin
[2025-08-22T10:52:00.992+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:00.996+08:00] waitForNavigation end
[2025-08-22T10:52:00.996+08:00] screenshotBase64 begin
[2025-08-22T10:52:00.997+08:00] waitForNavigation end
[2025-08-22T10:52:00.997+08:00] evaluate function begin
[2025-08-22T10:52:01.016+08:00] evaluate function end
[2025-08-22T10:52:01.016+08:00] getElementsNodeTree end, cost: 19ms
[2025-08-22T10:52:01.094+08:00] screenshotBase64 end, cost: 98ms
[2025-08-22T10:52:04.482+08:00] waitForNavigation begin
[2025-08-22T10:52:04.482+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:04.493+08:00] waitForNavigation end
[2025-08-22T10:52:04.493+08:00] screenshotBase64 begin
[2025-08-22T10:52:04.584+08:00] screenshotBase64 end, cost: 91ms
[2025-08-22T10:52:04.695+08:00] waitForNavigation begin
[2025-08-22T10:52:04.695+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:04.695+08:00] waitForNavigation begin
[2025-08-22T10:52:04.695+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:04.699+08:00] waitForNavigation end
[2025-08-22T10:52:04.700+08:00] screenshotBase64 begin
[2025-08-22T10:52:04.700+08:00] waitForNavigation end
[2025-08-22T10:52:04.700+08:00] evaluate function begin
[2025-08-22T10:52:04.702+08:00] evaluate function end
[2025-08-22T10:52:04.702+08:00] getElementsNodeTree end, cost: 2ms
[2025-08-22T10:52:04.797+08:00] screenshotBase64 end, cost: 97ms
[2025-08-22T10:52:04.906+08:00] waitForNavigation begin
[2025-08-22T10:52:04.906+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:04.907+08:00] waitForNavigation begin
[2025-08-22T10:52:04.907+08:00] waitForNavigation timeout: 5000
[2025-08-22T10:52:04.911+08:00] waitForNavigation end
[2025-08-22T10:52:04.911+08:00] screenshotBase64 begin
[2025-08-22T10:52:04.911+08:00] waitForNavigation end
[2025-08-22T10:52:04.911+08:00] evaluate function begin
[2025-08-22T10:52:04.914+08:00] evaluate function end
[2025-08-22T10:52:04.914+08:00] getElementsNodeTree end, cost: 3ms
[2025-08-22T10:52:04.994+08:00] screenshotBase64 end, cost: 83ms
{
"summary": {
"total": 1,
"successful": 1,
"failed": 0,
"totalDuration": 31460,
"generatedAt": "2025/8/22 10:52:12"
},
"results": [
{
"script": "..\\..\\static-pages.yaml",
"success": true,
"report": "..\\report\\static-pages-2025-08-22_10-51-48-jrwfbto4.html",
"duration": 31460
}
]
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
<h1>My App</h1>
<a href="list.html" target="_blank">Go to planet list</a>
\ No newline at end of file
<h1>Planet List</h1>
<ul>
<li>Earth</li>
<li>Mars</li>
<li>Jupiter</li>
</ul>
\ No newline at end of file
web:
#要测试的网址
url: https://jiweidev.jiweinet.com/
#浏览器窗口大小配置
shareBrowserContext: true
viewportWidth: 2580
viewportHeight: 1320
#用例编写
tasks:
####################################【顶部静态页面】####################################
# - name: 【行业咨询】页面验证不包含404
# flow:
# - ai: 点击 "行业咨询"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
#
# - name: 【品牌营销】页面验证不包含404
# flow:
# - ai: 点击 "品牌营销"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
#
# - name: 【集微资讯】页面验证不包含404
# flow:
# - ai: 点击 "集微咨询"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
#
# - name: 【知识产权】页面验证不包含404
# flow:
# - ai: 点击 "知识产权"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
#
# - name: 【集微职场】页面验证不包含404
# flow:
# - ai: 点击 "集微职场"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
#
# - name: 【集微投融资】页面验证不包含404
# flow:
# - ai: 点击 "集微投融资"按钮
# - sleep: 3000
# - aiAssert: 查询结果不包含“404”
# - aiAssert: 详情页面无报错
- name: 【集微企业库】页面验证不包含404
flow:
- ai: 点击 "集微企业库"按钮
- sleep: 1000
- aiAssert: 查询结果不包含“404”
- aiAssert: 详情页面无报错
\ No newline at end of file
{
"name": "ijiwei-yaml",
"private": true,
"version": "1.0.0",
"description": "> quick start",
"main": "index.js",
"type": "module",
"scripts": {
"test": "midscene ./ijiwei-web",
"test:config": "midscene --config config.yml"
},
"author": "",
"license": "MIT",
"devDependencies": {
"@midscene/cli": "^0.26.6"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment