RE: Unable locate element using follwoing HTML

hello everyone, Thanks to everyone here.

**My code:**

driver.findElement(By.className(“endor-ActionBar-item coral-Button coral-Button–quiet coral-Button–graniteActionBar”)).click();

**Here is the HTML:**


<a class=”endor-ActionBar-item coral-Button coral-Button–quiet coral-Button–graniteActionBar data-within=”.endor-Page-content data-align-from=”left data-point-from=”bottom data-toggle=”popover href=”#popover-06026e5a-015b-41a8-ad5b-7ed7b22b551b title=”Create>
<i class=”coral-Icon coral-Icon–add></i>
<span>Create</span>
</a>

I tried to locate element using className, but its came up with an **error**:
The given selector endor-ActionBar-item coral-Button coral-Button–quiet coral-Button–graniteActionBar is either invalid or does not result in a WebElement. The following error occurred:
InvalidSelectorError: Compound class names not permitted

Sam_tester Default Asked on January 14, 2016 in Selenium WebDriver.
Add Comment
1 Answers

Why don’t you use the relative Xpath for local element get. This Selector works for most of Cases.
Do let me know whether this way works or not on ‘sandeep.duve@gmail.com’

Train Answered on January 22, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.