I’m trying to build my first test with selenium and got a problem.
I’m searching for a element, no problem. I can click on it, get the
text in the element… every thing works fine.
But double click on the element just doesn’t work. Selenium
clicks in the wrong location. I made a screenshot of this situation:
To find the row i use xpath and search for the text in the cell, but this text is unique(I checked it)
private readonly string _identityPath = ".//td[.= 'All Employees']";
...
mainPage.FindElement(By.XPath(_identityPath)).Click(); //Works(dotted box)
Actions builder = new Actions(mainPage);
IAction doubleClick = builder.DoubleClick(mainPage.FindElement(By.XPath(_identityPath))).Build();
doubleClick.Perform(); //wrong location/element
/*
Actions action = new Actions(mainPage);
action.DoubleClick(mainPage.FindElement(By.XPath(_identityPath)));
action.Perform(); *///wrong location/element
This page is in an iframe and the grid is a dojo component… maybe the problem
comes from there. Any ideas whats wrong? I have no idea where this is coming from. :/
Greets
It is common issue that Actions builder does not work.
Using JavaScript should help – find answer in this thread:
Selenium 2/Webdriver – how to double click a table row (which opens a new window)