我自动化的页面有dxheViewArea。我想在此字段中输入一些文字。Webdriver找不到dxheViewArea的正确xpath
我webdriver的代码是:
d.FindElement(By.CssSelector(".dxheDesignViewArea dxheViewArea")).SendKeys("Who invented the first fixed witn aircraft?");
我在NUnit的运行,返回的错误是无法找到的元素:{"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#吧? –