I hope you can help me, I'm using selenium web driver and I want to locate a specific element in a website. I tried using cssSelector and xpath but I'm having a InvalidSelectorException and NoSuchElementException. Please see screenshot below for more details.
I'm trying to locate the BACK TO HOME button. By using firebug I was able to see the underlying HTML code of the BACK TO HOME button. I'm not familiar on how to handle the highlighted HTML code since most of the time a link usually has a name and a cssSelector=linkText("link name") would solve the problem and a quick copy xpath command can easily locate the element. But on this scenario both cssSelector and xpath did not worked.
How do can I locate this kind of HTML code?
You can try XPath as
Since here contains method is used you can use any substring of src attribute.