@@ -487,10 +487,13 @@ public ReadOnlyCollection<IWebElement> FindElementsById(string id)
487
487
/// </example>
488
488
public IWebElement FindElementByClassName ( string className )
489
489
{
490
- // TODO: Modified for spec-compliance. May change.
491
- // Requires cleanup after spec is at recommendation.
492
- // return this.FindElement("class name", className);
493
- return this . FindElement ( "css selector" , "." + className ) ;
490
+ // Element finding mechanism is not allowed by the W3C WebDriver
491
+ // specification, but rather should be implemented as a function
492
+ // of other finder mechanisms as documented in the spec.
493
+ // Implementation after spec reaches recommendation should be as
494
+ // follows:
495
+ // return this.FindElement("css selector", "." + className);
496
+ return this . FindElement ( "class name" , className ) ;
494
497
}
495
498
496
499
/// <summary>
@@ -506,10 +509,13 @@ public IWebElement FindElementByClassName(string className)
506
509
/// </example>
507
510
public ReadOnlyCollection < IWebElement > FindElementsByClassName ( string className )
508
511
{
509
- // TODO: Modified for spec-compliance. May change.
510
- // Requires cleanup after spec is at recommendation.
511
- // return this.FindElements("class name", className);
512
- return this . FindElements ( "css selector" , "." + className ) ;
512
+ // Element finding mechanism is not allowed by the W3C WebDriver
513
+ // specification, but rather should be implemented as a function
514
+ // of other finder mechanisms as documented in the spec.
515
+ // Implementation after spec reaches recommendation should be as
516
+ // follows:
517
+ // return this.FindElements("css selector", "." + className);
518
+ return this . FindElements ( "class name" , className ) ;
513
519
}
514
520
515
521
#endregion
@@ -598,10 +604,13 @@ public ReadOnlyCollection<IWebElement> FindElementsByPartialLinkText(string part
598
604
/// </example>
599
605
public IWebElement FindElementByName ( string name )
600
606
{
601
- // TODO: Modified for spec-compliance. May change.
602
- // Requires cleanup after spec is at recommendation.
603
- // return this.FindElement("name", name);
604
- return this . FindElement ( "css selector" , "*[name=\" " + name + "\" ]" ) ;
607
+ // Element finding mechanism is not allowed by the W3C WebDriver
608
+ // specification, but rather should be implemented as a function
609
+ // of other finder mechanisms as documented in the spec.
610
+ // Implementation after spec reaches recommendation should be as
611
+ // follows:
612
+ // return this.FindElement("css selector", "*[name=\"" + name + "\"]");
613
+ return this . FindElement ( "name" , name ) ;
605
614
}
606
615
607
616
/// <summary>
@@ -617,10 +626,13 @@ public IWebElement FindElementByName(string name)
617
626
/// </example>
618
627
public ReadOnlyCollection < IWebElement > FindElementsByName ( string name )
619
628
{
620
- // TODO: Modified for spec-compliance. May change.
621
- // Requires cleanup after spec is at recommendation.
622
- // return this.FindElements("name", name);
623
- return this . FindElements ( "css selector" , "*[name=\" " + name + "\" ]" ) ;
629
+ // Element finding mechanism is not allowed by the W3C WebDriver
630
+ // specification, but rather should be implemented as a function
631
+ // of other finder mechanisms as documented in the spec.
632
+ // Implementation after spec reaches recommendation should be as
633
+ // follows:
634
+ // return this.FindElements("css selector", "*[name=\"" + name + "\"]");
635
+ return this . FindElements ( "name" , name ) ;
624
636
}
625
637
626
638
#endregion
@@ -639,10 +651,13 @@ public ReadOnlyCollection<IWebElement> FindElementsByName(string name)
639
651
/// </example>
640
652
public IWebElement FindElementByTagName ( string tagName )
641
653
{
642
- // TODO: Modified for spec-compliance. May change.
643
- // Requires cleanup after spec is at recommendation.
644
- // return this.FindElement("tag name", tagName);
645
- return this . FindElement ( "css selector" , tagName ) ;
654
+ // Element finding mechanism is not allowed by the W3C WebDriver
655
+ // specification, but rather should be implemented as a function
656
+ // of other finder mechanisms as documented in the spec.
657
+ // Implementation after spec reaches recommendation should be as
658
+ // follows:
659
+ // return this.FindElement("css selector", tagName);
660
+ return this . FindElement ( "tag name" , tagName ) ;
646
661
}
647
662
648
663
/// <summary>
@@ -658,10 +673,13 @@ public IWebElement FindElementByTagName(string tagName)
658
673
/// </example>
659
674
public ReadOnlyCollection < IWebElement > FindElementsByTagName ( string tagName )
660
675
{
661
- // TODO: Modified for spec-compliance. May change.
662
- // Requires cleanup after spec is at recommendation.
663
- // return this.FindElements("tag name", tagName);
664
- return this . FindElements ( "css selector" , tagName ) ;
676
+ // Element finding mechanism is not allowed by the W3C WebDriver
677
+ // specification, but rather should be implemented as a function
678
+ // of other finder mechanisms as documented in the spec.
679
+ // Implementation after spec reaches recommendation should be as
680
+ // follows:
681
+ // return this.FindElements("css selector", tagName);
682
+ return this . FindElements ( "tag name" , tagName ) ;
665
683
}
666
684
#endregion
667
685
0 commit comments