I'm setting up a program in Java with Selenium.
At the start of the program, a Chrome extension I'm using with the program loads up with the Chrome instance.
Chrome then navigates to that page, selects all the boxes, and is supposed to click a button on the page that appears because of the extension.
When I inspect the element, all I see is this:
style="width: 140px; margin-left: 5px; height: 23px;">
<img src="websiteimage.png here" width="20px">Selected Task</a>
Exception in thread "main" org.openqa.selenium.InvalidSelectorException: invalid selector:
Unable to locate an element with the xpath expression //a[contains@class,'selected'] and contains(@class, 'repost-selected button-task') and contains(text(), 'Repost Selected') because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document':
The string '//a[contains@class,'selected'] and contains(@class, 'repost-selected button-task') and contains(text(), 'Repost Selected')' is not a valid XPath expression.
I figured out how to solve it:
The other answers weren't working because they either wouldn't find the object on the page, or would give compile errors