OpenQA.Selenium.Remote.RemoteWebDriver.FindElementsByCssSelector C# (CSharp) Method

FindElementsByCssSelector() public method

Finds all elements matching the specified CSS selector.
public FindElementsByCssSelector ( string cssSelector ) : ReadOnlyCollection
cssSelector string The CSS selector to match.
return ReadOnlyCollection
        public ReadOnlyCollection<IWebElement> FindElementsByCssSelector(string cssSelector)
        {
            return this.FindElements("css selector", cssSelector);
        }

Usage Example

Example #1
0
		public static void ShouldIncludeAtLeastOneLicense( RemoteWebDriver driver, AuthenticatingNavigator navigator ) 
		{
			using ( driver.FinallyQuitGuard() ) // TODO improve this using http://xunit.codeplex.com/workitem/9798 ( WAS: http://xunit.codeplex.com/discussions/362097 )
			{
				navigator.NavigateWithAuthenticate( driver, "license" );
				
				// Even when cold, 5 seconds is a long time to wait
				WebDriverWait wait = new WebDriverWait( driver, TimeSpan.FromSeconds( 5 ) );
				wait.Until( d => driver.FindElementsByCssSelector( "#licenses tr" ).Count > 0 );
			}
		}
All Usage Examples Of OpenQA.Selenium.Remote.RemoteWebDriver::FindElementsByCssSelector