So I've got a bing map on my web page and the user can draw a area which they want to search with in by clicking on the points and closing the shape up.
I'm trying to automate this using webdriver however when I call click it clicks in the middle of the map.
It is basically the same issue as this question but the problem is with the c# driver rather than the java.
Here is my code:
RemoteWebDriver driver = ScenarioContext.Current.Get<RemoteWebDriver>();
driver.FindElementById("location").SendKeys("London");
driver.FindElementById("find").Click();
driver.FindElementById("boundry").Click();
IWebElement map = driver.FindElementById("Map");
Actions actions = new Actions(driver);
actions
.MoveToElement(map, -100, -100)
.Click()
.Build()
.Perform();
actions
.MoveToElement(map, -100, 100)
.Click()
.Build()
.Perform();
actions
.MoveToElement(map, 100, -100)
.Click()
.Build()
.Perform();
actions
.MoveToElement(map, 100, 100)
.Click()
.Build()
.Perform();
actions
.MoveToElement(map, -100, -100)
.Click()
.Build()
.Perform();
What happens is the mouse moves to the correct position and then the click event resets the mouse pointer to the middle of the element.