Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用SeleniumWebDriverRuby测试调色板_Ruby_Selenium Webdriver - Fatal编程技术网

使用SeleniumWebDriverRuby测试调色板

使用SeleniumWebDriverRuby测试调色板,ruby,selenium-webdriver,Ruby,Selenium Webdriver,如何使用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 下面的代码应该实现您想要实现的功能。有关更多参考,请参阅 或者尝试从更改代码 drive

如何使用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

下面的代码应该实现您想要实现的功能。有关更多参考,请参阅

或者尝试从更改代码

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


你的调色板是什么样子的?请显示DOM。请在此处共享您正在使用的
selenium webdriver
html
代码。您能给我
鼠标
方法的链接吗?@RubyLovely:查看
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