0

I am automating a process in Chrome, but my script can't find the element. I have double checked the XPath with DevTools, and it is the correct Path.

The element is not in a iframe, it is nested inside a Div.

I am using the Selenium.keys.Control method to ctrl click on a link. I can click on the element by using the javascriptExecutor ("arguments[0].click();", var), but I have not found a way to ctrl click using the Executor.

HaveSpacesuit
  • 3,572
  • 6
  • 40
  • 59
  • Have you tried to `Actions actions = new Actions(driver); actions.keyDown(Keys.LEFT_CONTROL).click(element).build().perform();`? – Dilip Meghwal Sep 16 '20 at 11:49
  • I was just about to do it, I dappled in it before, but it did not seem to work. I will try again. Thanks mate :) Have a great day – Peter Bandsholm Sep 16 '20 at 12:10
  • @DilipMeghwal Do you know if I can use JavascriptExecutor in a Actions stream? I think that would solve my issue. It seems like the Web dev's messed up the code and is blocking an element with a parent. So I cant call it with Selenium. – Peter Bandsholm Sep 16 '20 at 13:10
  • Perform this as `Step 1` : `Actions actions = new Actions(driver); actions.keyDown(Keys.LEFT_CONTROL).build().perform();` and then `use JavaScript Executor to click on element`. – Dilip Meghwal Sep 16 '20 at 13:53

0 Answers0