1

如何使用selenium webdriver ruby​​ 测试调色板。我尝试使用下面的代码,但它不起作用

location=driver.find_element(:id,"color-palette").location
   driver.mouse.move_to(driver.find_element(:id,"color-palette"),location.x,location.y).click
4

1 回答 1

0

以下代码应该可以实现您想要实现的目标。如需进一步参考,请参见此处

el = driver.find_element(:id, "color-palette")
driver.action.click(el).perform

或尝试更改您的代码

driver.mouse.move_to(driver.find_element(:id,"color-palette"),location.x,location.y).click

driver.action.move_to(driver.find_element(:id,"color-palette"),location.x,location.y).click
于 2013-05-29T07:06:35.527 回答