Reputation: 147
I am working on a qa automation project using Selenium webdriver.
I need to perform drag and drop on a telerik rad grid for reordering columns and then right click on the grid to save the changes made.
Is there any way i can achieve these using selenium webdriver ?
Thanks.
Upvotes: 8
Views: 9074
Reputation: 41
you can click in same action when it disappears as soon as it appears... just like
action.ContextClick(element).Click(x axis, y axis).build.perform();
it will works..
Upvotes: 3
Reputation: 1629
For drag and drop you may try:
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium;
RemoteWebDriver driver = new FirefoxDriver();
Actions action = new Actions(driver);
IWebElement sourceElement = FindElement(By.Id("id1"));
IWebElement targetElement = FindElement(By.Id("id2"));
IWebElement gridElement = FindElement(By.Id("grid"));
action.DragAndDrop(sourceElement, targetElement).Perform(); //drag&drop
Thread.Sleep(500); //if necessary
action.ContextClick(gridElement).Perform(); //right click
or you may use JavaScript for this.
Upvotes: 11