51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

查看: 1293|回复: 1

[在学] 为什么找不到这个login button来点击呢?

[复制链接]

该用户从未签到

发表于 2019-3-7 11:52:48 | 显示全部楼层 |阅读模式
这是网页的元素。 最后动作就是点击login但是脚本说找不到这个id的button. 为什么找不到? 1.png

运行结果是:
KEYWORD Selenium2Library . Click Button id=submitButton
Documentation:
Clicks button identified by locator.
Start / End / Elapsed:20190213 23:17:04.251 / 20190213 23:17:04.290 / 00:00:00.039
00:00:00.000KEYWORD Capture Page Screenshot
Start / End / Elapsed:20190213 23:17:04.287 / 20190213 23:17:04.287 / 00:00:00.00023:17:04.287FAILMultiple keywords with name 'Capture Page Screenshot' found. Give the full name of the keyword you want to use: Selenium2Library.Capture Page Screenshot SeleniumLibrary.Capture Page Screenshot
23:17:04.251INFOClicking button 'id=submitButton'.
23:17:04.288WARNKeyword 'Capture Page Screenshot' could not be run on failure: Multiple keywords with name 'Capture Page Screenshot' found. Give the full name of the keyword you want to use: Selenium2Library.Capture Page Screenshot SeleniumLibrary.Capture Page Screenshot
23:17:04.290FAILButton with locator 'id=submitButton' not found.
发现用Click Element 这个关键字管用。这个跟click button的区别是什么,为什么click button 在我的这种情况下不管用?


在学课程:
RobotFramework自动化测试框架快速入门


回复

使用道具 举报

该用户从未签到

发表于 2019-3-7 11:54:55 | 显示全部楼层
button一般是指input标签,并且type=“button”的元素。这类元素才可用click button。

对于可点击的任何元素,都可用click element。这个关键字更通用。
回复 支持 反对

使用道具 举报

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

GMT+8, 2024-4-16 20:27 , Processed in 0.071188 second(s), 26 queries .

Powered by Discuz! X3.2

© 2001-2024 Comsenz Inc.

快速回复 返回顶部 返回列表