Skip to content

Commit 4c2a101

Browse files
authored
Merge pull request #6 from techartdev/develop
Develop
2 parents f406fcb + e07bc0d commit 4c2a101

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Selenium.WebDriver.SimpleExtensions/Selenium.WebDriver.SimpleExtensions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<PackageTags>selenium;extensions;sibling;parent</PackageTags>
1313
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
1414
<PackageReadmeFile>README.md</PackageReadmeFile>
15-
<Version>1.0.2</Version>
15+
<Version>1.0.3</Version>
1616
</PropertyGroup>
1717

1818
<ItemGroup>

Selenium.WebDriver.SimpleExtensions/WebElementExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using OpenQA.Selenium;
22
using System;
33
using System.Collections.Generic;
4+
using System.Xml.Linq;
45

56
namespace Selenium.WebDriver.SimpleExtensions
67
{
@@ -26,6 +27,11 @@ public static IWebElement GetSiblingByIndex(this IWebElement e, int index)
2627
return e.FindElement(By.XPath($"following-sibling::*[{index}]"));
2728
}
2829

30+
public static IReadOnlyCollection<IWebElement> GetSiblings(this IWebElement e)
31+
{
32+
return e.FindElements(By.XPath("./following-sibling::* | ./preceding-sibling::*"));
33+
}
34+
2935
public static IWebElement GetFirstChild(this IWebElement e)
3036
{
3137
return e.FindElement(By.XPath("child::*[1]"));

0 commit comments

Comments
 (0)