I write test in selenium. I have span element. When user select text in this span and press ctrl+c, in this page will popup windows. But how can I select this text programmatically? I tried two way: use selenium call webElement.Click() 3 times. Because I know, if three times click by span, then will select all text in this span. But it throw exception, that System.InvalidOperationException: unknown error: Element is not clickable at point Also I tried programmatically via c# move and click cursor. But problem is, that in virtual machine in test agent, the cursor doesn't move. So Can you help me select text in span?
Asked
Active
Viewed 622 times
0
-
http://stackoverflow.com/questions/9978081/select-a-text-and-perform-a-click-action – ex-zac-tly Mar 11 '15 at 18:45
2 Answers
2
Why make the task way more complicated than it should be? You can make this simpler by doing:
String text = driver.findElement(By.id("theSpanElementId")).getText();
// now you have the text from the <span> element stored.

ddavison
- 28,221
- 15
- 85
- 110