Can some one please suggest a proper CSS name to find this element



  • enter image description here

    I need to click on the above button just using

    CSSSelector

    . I have tried with ;

    > IWebElement el4m =
    > Driver.FindElement(By.CssSelector("input[type='button'][contain='Search']"));
    > IWebElement el4m =
    > Driver.FindElement(By.CssSelector("input[type='button'][innerText='Search']"));
    > IWebElement el4m =
    > Driver.FindElement(By.CssSelector("input[type='button'][textContent='Search']"));
    

    But nothing works fine. Can some 1 please advice me a correct CSSSelector for above button.



    • Driver.FindElement(By.CssSelector("button[class*=buttondefault]")); using wildcard selector (*) which means if the class attribute has this proprety at any place it will find this element or
    • Driver.FindElement(By.CssSelector("button[class^=buttondefault]")); using caveat selector to find elements starting with "buttondefault" attribute or
    • Driver.FindElement(By.CssSelector("button[class=buttondefault]")); using = to find elements having class attribute equal to buttondefault


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2