【发布时间】:2014-06-21 16:21:06
【问题描述】:
我正在自动化的页面有一个 dxheViewArea。我想在这个字段中输入一些文字。
我的 Webdriver 代码是:
d.FindElement(By.CssSelector(".dxheDesignViewArea dxheViewArea")).SendKeys("Who invented the first fixed witn aircraft?");
我在 NUnit 中运行,返回的错误是 Unable to locate element:{"method":"css selector","selector":".dxheDesignViewArea dxheViewArea"}
在 Firefox 中我检查元素,代码是:
<body class="dxheDesignViewArea dxheViewArea" style="border-width: 0px;" spellcheck="false"/>
请问我可以使用什么 Xpath 语法来定位并在此元素中输入一些文本?
完整来源在这里:
<style/>
<link href="/DXR.axd?r=4_1" type="text/css" rel="stylesheet"/>
<style charset="utf-8" type="text/css">xxxxxxxx</style>
<style id="firepath-matching-node-style" type="text/css">.firepath-matching-node { outline: 2px dashed #00F;}</style>
</head>
<body class="dxheDesignViewArea dxheViewArea" style="border-width: 0px;" spellcheck="false"/>
</html>
【问题讨论】:
标签: c# xpath selenium-webdriver