Selenium无法检测ms团队(web)调用接口中的元素



Selenium没有检测到微软团队(web(调用接口中的元素(在调用连接后(。例如:

'Store xpath count' action with xpath=\profile-picture 

返回零个条目(事先使用了显式等待以确保页面已完全加载(

使用chrome的开发工具执行的完全相同的xpath返回了4个条目。

其他动作和其他元素(包括使用硒元素定位器选择器选择的元素(也会获得类似的结果。

是不是有什么东西让我无法掌握这些元素?

该页面似乎没有任何iframe(这可能导致这种行为(。

从selenium IDE侧文件请求的代码试用(NB需要登录团队实例,而不需要其他弹出窗口和电话号码进行测试(:

{
"id": "d0ff19e7-9ada-4a49-96f3-f43649709cff",
"version": "2.0",
"name": "TeamsTest",
"url": "",
"tests": [{
"id": "e9060b4d-c8d0-4ad4-972c-029bc4403b4c",
"name": "Untitled",
"commands": [{
"id": "cdd5f51d-31b9-465a-9d64-c7c6b8ad19a9",
"comment": "",
"command": "open",
"target": "/_#/calls/saved-calls",
"targets": [],
"value": ""
}, {
"id": "094ae461-1b76-442d-822f-36c844913720",
"comment": "",
"command": "setWindowSize",
"target": "1366x698",
"targets": [],
"value": ""
}, {
"id": "20dd83d6-d0e3-4ccf-8ae7-55a90acf1791",
"comment": "",
"command": "waitForElementPresent",
"target": "xpath=//iframe[starts-with(@id,'experience-container')]",
"targets": [],
"value": "30000"
}, {
"id": "6600e22d-8d34-4aee-86d1-78d79929b34a",
"comment": "",
"command": "selectFrame",
"target": "index=0",
"targets": [],
"value": ""
}, {
"id": "27542c6e-b6f5-4f53-a54e-4a51708f6d1a",
"comment": "",
"command": "type",
"target": "id=people-picker-input",
"targets": [],
"value": "<phone number>"
}, {
"id": "49de70ea-857e-46b3-aa7f-bd6a5da78d43",
"comment": "",
"command": "click",
"target": "xpath=//button[contains(.'Call')]",
"targets": [],
"value": ""
}, {
"id": "4b20b541-c56c-44ba-a4ad-fbe3c3abec50",
"comment": "",
"command": "pause",
"target": "10000",
"targets": [],
"value": ""
}, {
"id": "6aa3673a-6b4f-4543-aea1-5b370f83942f",
"comment": "",
"command": "storeXpathCount",
"target": "xpath=//profile-picture",
"targets": [],
"value": "out"
}, {
"id": "2eba7802-2b98-4765-9fe7-cc664803af4d",
"comment": "",
"command": "echo",
"target": "${out}",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "6b30048a-ecf9-4c60-bc27-cde0df580edd",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["e9060b4d-c8d0-4ad4-972c-029bc4403b4c"]
}],
"urls": [],
"plugins": []
}

问题是在设置调用时输入了iframe,但没有执行切换回默认帧。一旦发出了切换回默认上下文的适当命令,问题就得到了解决。

相关内容

最新更新