FindElement with xPath does not work properly - contains @class

Issue #8503401 • Assigned to Travis L.

Details

Author
Christiane S.
Created
Aug 16, 2016
Privacy
This issue is public.
Reports
Reported by 3 people

Sign in to watch or report this issue.

Steps to reproduce

If you try to find an element with xPath where you search a substring of the class the element can not be found.

E.g.

<div class="foo-bar test">

This does not work:
Driver.FindElement(By.xpath("//div[contains(@class, ‘foo’)]"))

This works:
Driver.FindElement(By.xpath("//div[contains(@class, ‘foo-bar’)]"))

Attachments

0 attachments

    Comments and activity

    • Microsoft Edge Team

      Changed Assigned To to “Brad E.”

      Changed Assigned To to “Travis L.”

    • i have around 12 automation scenarios all work fine in other browsers like Chrome, in Edge they all fail because of the xpath locators do not work in Edge.

      trying to narrow down the discrepancy with edge, any suggestions ???

      environment details:
      Edge driver 2.0 windows 10 enterprise, version 1511, os build 10586.679

    You need to sign in to your Microsoft account to add a comment.

    Sign in