I am using Selenium and Java to try and automate some google maps navigation. I want to click and hold on the map, then move to a certain direction, then release the cursor. This should move the map across the page.
So far I have
WebElement canvasElement = driver.findElement(map);
Actions builder = new Actions(driver.getWebDriver());
builder.moveToElement(canvasElement).clickAndHold().moveByOffset(300, 0).release().perform();
However, nothing on the page moves. I know I am selecting the map correctly since if I just do
builder.moveToElement(canvasElement).clickAndHold().moveByOffset(300, 0).perform();
then when I mouse over the map, the map moves without me having to click the left mouse button because it is still in the click and hold state and never released. Not sure why the moveByOffset is not working for this particular case. Any suggestions would be great
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/e9db523c-c535-4969-8442-5d32f3e420b5%40googlegroups.com.
May I ask why you are trying to do that?
On Tue, 3 Mar 2020 at 20:36, airick <ericl...@gmail.com> wrote:
--I am using Selenium and Java to try and automate some google maps navigation. I want to click and hold on the map, then move to a certain direction, then release the cursor. This should move the map across the page.
So far I have
WebElement canvasElement = driver.findElement(map);
Actions builder = new Actions(driver.getWebDriver());
builder.moveToElement(canvasElement).clickAndHold().moveByOffset(300, 0).release().perform();However, nothing on the page moves. I know I am selecting the map correctly since if I just do
builder.moveToElement(canvasElement).clickAndHold().moveByOffset(300, 0).perform();then when I mouse over the map, the map moves without me having to click the left mouse button because it is still in the click and hold state and never released. Not sure why the moveByOffset is not working for this particular case. Any suggestions would be great
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/97bf46da-194d-4b5c-ac1b-6f1382e318e5%40googlegroups.com.