click on links from an array

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

click on links from an array

Abdel Latif
HI,
I have an array that has hrefs :

arr=["https://demo.massbrc.com/applicants/57/applicant_identity_documents/new", "https://demo.massbrc.com/applicants/47/applicant_identity_documents/new"]


arr.each do |link|
  driver.find_element(xpath: "//*[@href='#{link}']").click
  driver.navigate.back
end

when I run it I got :

Unable to locate element: //*[@href="#{link}"] (Selenium::WebDriver::Error::NoSuchElementError)

Thanks, your help is appreciated.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7f61108b-54e3-485b-9d7e-53de55152810%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.