0

I am trying to select and click on this <span>

<span class="el-icon 28-0"></span>

in the below hierarchy but unable to do so.

<div class="list-wrap ng-scope" ng-repeat="d in cols">
            <div class="list-element selected" ng-click="a.cb(d.name, member.name)" ng-class="{selected: (selectValue === d.name || selectValue === member.name + ' ' + d.name)}">
                <span class="el-icon 28-0"></span>
                <!-- ngIf: !d.displayName --><span ng-if="!d.displayName" class="el-text ng-binding ng-scope">
                     28.0 
                </span><!-- end ngIf: !d.displayName -->
                <!-- ngIf: d.displayName -->
            </div>
        </div>
 <div class="list-wrap ng-scope" ng-repeat="d in cols">
            <div class="list-element" ng-click="a.cb(d.name, member.name)" ng-class="{selected: (selectValue === d.name || selectValue === member.name + ' ' + d.name)}">
                <span class="el-icon 27-0"></span>
                <!-- ngIf: !d.displayName --><span ng-if="!d.displayName" class="el-text ng-binding ng-scope">


                     27.0 
                </span><!-- end ngIf: !d.displayName -->
                <!-- ngIf: d.displayName -->
            </div>
        </div>

This is the page , I am referencing

https://docs.saucelabs.com/reference/platforms-configurator/?_ga=1.5883444.608313.1428365147#/

In "Browser" section, I am trying to select FF 28.0

I've tried

@driver.find_element(:css,"span.el-icon.28-0")

BUt it gives

The given selector span.el-icon.28-0 is either invalid or does not result in a WebElement.

Tried this too

@driver.find_element(:css,"span.el-text.ng-binding.ng-scope").click

which gives

 Element is not currently visible and so may not be interacted with
BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
user1207289
  • 3,060
  • 6
  • 30
  • 66

1 Answers1

0

Valid CSS classes cannot start with a number.

If changing the class name is not an option for you, try changing the selector to span.el-icon[class*="28-0"]

Note: The 'contains' selector [class*=...] matches any elements whose given attribute contains the given value. In this case, any element with a class attribute containing '28-0' would be matched. You could also do this with things like alt, src or href to match external images or links. Read more here.

Community
  • 1
  • 1
  • thank you for your reply . It didnt worked exactly like that but I added some code to make it work `element=@driver.find_element(:css,"[class*='28-0']")` `@driver.execute_script("arguments[0].click()" , element) ` – user1207289 Jul 30 '15 at 02:36