I am trying to convert this code from one of my previous projects in Java to C#. Just wondering what is the equivalent to .get(index) in C# for an element?
links_myAccountNav.findElements(By.tagName("a")).get(i).sendKeys(clickOnLinkTab);
Full code in Java
List<WebElement> li_All = links_myAccountNav.findElements(By.tagName("a"));
for (int i = 0; i < li_All.size(); i++) {
String clickOnLinkTab = Keys.chord(Keys.CONTROL, Keys.ENTER);
links_myAccountNav.findElements(By.tagName("a")).get(i).sendKeys(clickOnLinkTab);
} // Opens all the tabs
Set<String> getTitleinWindow = driver.getWindowHandles();
Iterator<String> it = getTitleinWindow.iterator();
List<String> actualTitleList = new ArrayList<>();
while (it.hasNext()) {
driver.switchTo().window(it.next());
actualTitleList.add(driver.getTitle());
}
return actualTitleList;
Aucun commentaire:
Enregistrer un commentaire