Reputation: 34
I want to perform a simple test case with selenium in Visual Studio(C#). For this reason, I wrote a short code to click on the variables of a random website, I accessed the buttons with the id, class or xpath, but I get an error like this -> openQA.selenium.Element.Click.Intercepted
If the narration is insufficient, I can add the codes.
Upvotes: 0
Views: 1183
Reputation: 26
You must use javascriptexecutor this situation. For example,
WebDriver driver; // assume assigned elsewhere
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
string title = (string)js.ExecuteScript("return document.title");
Upvotes: 1