Monday, July 13, 2015

C# Selenium - get attribute value using Css selector

Use following method to get attribute value using css selector

public String GetIDcss(string css)
        {
            string id = driver.FindElement(By.CssSelector(@" + css + @")).GetAttribute("id");
            return id;
        }

0 comments