对于selenium webdriver,是否有一个java命令可以获取网页上的下一个元素? (相当于用户按下标签按钮)
答案 0 :(得分:0)
您可以使用以下内容:
driver.findElement(By.name("userName")).sendKeys(Keys.TAB); //this will press the tab on your current element
driver.switchTo().activeElement().sendKeys("YourInput");//this will put the focus on your current element i.e. next element and you can perform any function as desired.