我已经通过xpath教程并检查了许多其他帖子,因此我不确定我缺少什么.我只是想通过xpath找到以下元素:
<input class="t-TextBox" type="email" test-id="test-username"/>
Run Code Online (Sandbox Code Playgroud)
我尝试了很多东西,例如:
element = findElement(By.xpath("//[@test-id='test-username']"));
Run Code Online (Sandbox Code Playgroud)
错误是Expression is not a legal expression
.
我在MacBook上使用Firefox
任何建议将不胜感激.