Groups
Groups
Sign in
Groups
Groups
WATF Forum
Conversations
About
Send feedback
Help
[讨论]如何使用Selenium选择右键菜单?
95 views
Skip to first unread message
Bear Wu
unread,
Aug 17, 2011, 3:03:03 AM
8/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WATF Forum
到目前为止,还没有找到合适的办法,来让Selenium支持选择右键菜单的操作。Selenium的API中,与右键菜单相关的有:
selenium.contextMenu( String locator );
selenium.contextMenu( String locator, String coordinate );
这两个方法仅相当于用户点击鼠标右键的操作,即打开右键菜单的操作;对于怎么选择右键菜单,它们就没什么帮助了。我想,也许是Selenium的
底层实现机制决定了它无法像SilkTest那样地选择右键菜单。
我曾经尝试用selenium.clickAt( String locator, String coordinate )来选择右键菜单中
的某一项,但是不成功。selenium还是直接点击了该locator,好像已经打开的右键菜单不存在一样。
很遗憾,对于GlobalSight中的那个case,键盘操作也无效,按up, down, enter等键,那个右键菜单根本就没有响应。
So, how?
Jester Xu
unread,
Aug 17, 2011, 3:05:03 AM
8/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to watf-...@googlegroups.com
哪一个test case,如果解决不了,有方法绕过么?
Bury Huang
unread,
Aug 17, 2011, 3:09:50 AM
8/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WATF Forum
纠正一个帖子中的的错误, selenium.contextMenu( String locator );
selenium.contextMenu( String locator, String coordinate );
应该是:
selenium.contextMenu( String locator );
selenium.contextMenuAt( String locator, String coordinate );
涉及到的case是:MyActivitiesJobEditorVerify.java
Jester Xu
unread,
Aug 17, 2011, 3:18:05 AM
8/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to watf-...@googlegroups.com
这个问题可以通过设置默认的编辑器绕开右键打开的问题。
iMyAccountFuncs.changeDefaultEditor(selenium, "Popup");
iMyAccountFuncs.changeDefaultEditor(selenium, "Inline");
可以通过设置这个编辑器,接着使用click直接打开,即可出现编辑器。目前来说只有这一个方法解决。。。现在case里已经包含这些了!
-----Original Message-----
From:
watf-...@googlegroups.com
[mailto:
watf-...@googlegroups.com
] On Behalf Of Bury Huang
Sent: Wednesday, August 17, 2011 12:10 AM
To: WATF Forum
Bear Wu
unread,
Aug 17, 2011, 3:20:53 AM
8/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to watf-...@googlegroups.com
Good News!
-----邮件原件-----
发件人:
watf-...@googlegroups.com
[mailto:
watf-...@googlegroups.com
] 代表 Jester Xu
发送时间: 2011年8月17日 0:18
收件人:
watf-...@googlegroups.com
主题: RE: 如何使用Selenium选择右键菜单?
Reply all
Reply to author
Forward
0 new messages