click on links from an array

19 views
Skip to first unread message

Abdel Latif

unread,
Apr 19, 2018, 2:26:41 PM4/19/18
to Ruby on Rails: Talk
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.

Reply all
Reply to author
Forward
0 new messages