WarLoCk
WarLoCk

Reputation: 53

XPath syntax? InvalidSelectorException: Not a legal expression

    findElement(xpath("(//input[@class='selected-flag']")).sendKeys(countryCode);

Is this the correct syntax for a XPath? I get the error

Not a legal Expression

and unable to locate the element.

Upvotes: 1

Views: 45

Answers (1)

kjhughes
kjhughes

Reputation: 111621

Delete the extra opening (:

findElement(xpath("(//input[@class='selected-flag']")).sendKeys(countryCode);
                   ^

Upvotes: 1

Related Questions