IWebElement element = driver.FindElement(By.XPath("//img[@name='jack']"));
new Actions(driver).MoveToElement(element).Perform(); //Here i am moving driver to that element.
ILocatable loc = (ILocatable)element; // Here i am getting co-ordinates of that element.
IMouse mouse = ((IHasInputDevices)driver).Mouse; // Here i am converting driver as a mouse device.
mouse.Click(loc.Coordinates); //Here driver click on that coordinates.
IWebElement element = driver.FindElement(By.XPath("//img[@name='jack']"));
new Actions(driver).MoveToElement(element).Perform();
ILocatable loc = (ILocatable)element;
IMouse mouse = ((IHasInputDevices)driver).Mouse; // Converting driver as a Mouse
mouse.ContextClick(loc.Coordinates); //Right Click
IKeyboard key = ((IHasInputDevices)driver).Keyboard; // Converting driver as a Keyboard
key.SendKeys("w");
Hiç yorum yok:
Yorum Gönder