【发布时间】:2014-09-19 06:46:56
【问题描述】:
我正在自动化网页。一个对象没有任何唯一标识。我应该用什么作为它的唯一标识符,你们能给我一些建议吗?这是一个富文本编辑器。我将如何在其中输入我的文本?
当我使用 id (ctl00_m_HelpDeskRequestRightColumn_ctl00_txtDetails) 作为其标识符时,它会抛出一个异常 The expected element "<my object's name>" is not visible
<body class="ms-formbody" scroll="yes" style="border-top-width: medium;
border-right-width: medium; border-bottom-width: medium;
border-left-width: medium; border-top-style: none; border-right-style:
none; border-bottom-style: none; border-left-style: none;
background-color: white;" contentEditable="true" WebLocale="1033"
BaseElementID="ctl00_m_HelpDeskRequestRightColumn_ctl00_txtDetails"
wordWrap="false" ondragdrop="function anonymous() { RTE_OnDrop(this); }"
RestrictedMode="true" AllowHyperlink="true" >
这是该对象的检查元素描述。
[我正在使用 eclipse 在 java 中编写我的 selenium webdriver 脚本。]
【问题讨论】:
-
能否提供您所定位元素的 HTML sn-p?
-
已编辑。第一次没有显示
-
您是否尝试使用 Xpath 或 CSS 来识别它?
-
请帮助我,它对应的 xpath 或 cssSelector 是什么?
标签: java html eclipse selenium-webdriver uniqueidentifier