Mislav
Mislav

Reputation: 1563

Unable to click on element using (R)Selenium

I ma trying to find element using RSelenium

remDr <- remoteDriver(remoteServerAddr = "192.168.99.100", port = 4445L,
                      browserName = "chrome")
remDr$open()
url <- "https://sudskapraksa.csp.vsrh.hr/decisionPdf?id=090216ba8084ca52"
remDr$navigate(url)

There is a captcha image (if you don't see it try to execute navigate part 10 times) I tried to select using:

  captcha_element <- remDr$findElement(using = "css selector", "img[id='captchaImg']")$clickElement()
  captcha_element <- remDr$findElement(using = "id", "captchaImg")$clickElement()
  captcha_element <- remDr$findElement(using = "xpath", "//*[@id='captchaIm']")$clickElement()

but it always return an error.

Upvotes: 1

Views: 1270

Answers (1)

undetected Selenium
undetected Selenium

Reputation: 193108

As per your code trials and subsequent comment update to identify the captcha image you can use the following Locator Strategy but of-coarse you can't invoke the click event as none of the element attributes contain any such event :

captcha_element <- remDr$findElement(using = "css selector", "img#captchaImg")

Upvotes: 1

Related Questions