I am working on automating the manipulation of an image element "svg" that contains 12 selectable parts (each with a "path" tag).
In my electron-angular application, I have been using js actions with Selenium to interact with buttons and other UI components. However, the Selenium Click function or Actions class is not effective for me in this particular application.
When attempting to click on one of the "svg" elements:
IWebElement patientIllustration = electron.driver.FindElement(By.Id("patientIllustration"));
IWebElement shadow = (IWebElement)jse.ExecuteScript("return arguments[0].shadowRoot", patientIllustration);
IWebElement body = shadow.FindElement(By.Id("adult_vascular"));
IReadOnlyCollection<IWebElement> parts = body.FindElements(By.TagName("path"));
IWebElement bodyPart = parts.ElementAt(0);
jse.ExecuteScript("arguments[0].scrollIntoView(true);", bodyPart);
jse.ExecuteScript("arguments[0].click();", bodyPart);
This results in the following error message:
OpenQA.Selenium.WebDriverException: 'unknown error: arguments[0].click is not a function (Session info: content shell=) (Driver info: chromedriver=2.36 (7361dbe5ac927be4276ec7da1d3548c4f22343a0),platform=Windows NT 10.0.14393 x86_64)'
I have also attempted to click on the bodyPart element using the Click() method and with the Actions class, but it had no effect. These methods did not work for any element within my application.
Does anyone have any alternative suggestions or ideas to try?