Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created October 3, 2016 12:42
Show Gist options
  • Select an option

  • Save executeautomation/d339d5ba35adeb46594fca1462d08957 to your computer and use it in GitHub Desktop.

Select an option

Save executeautomation/d339d5ba35adeb46594fca1462d08957 to your computer and use it in GitHub Desktop.
Identifying broken links with Selenium C#
@TabishKhan21

Copy link
Copy Markdown

In the above code, what does .Take() imply?

@karunakart

Copy link
Copy Markdown

I don't think there is any method called Take() on FindElements, @karthik any comments from your side?

@mhossen

mhossen commented Dec 27, 2020

Copy link
Copy Markdown

I don't think there is any method called Take() on FindElements, @karthik any comments from your side?

.Take() comes for System.Linq since FindElements returns you a collection (List) of elements, when you use Take(10), you are saying get me 10 item from the list of elements from the beginning of the list to 10. If you don't use take, it will simply return you all the elements found with By.TagName("a")

@karthik

karthik commented Dec 29, 2020

Copy link
Copy Markdown

Stop tagging me. I'm not the person you are looking for.

@mhossen

mhossen commented Dec 29, 2020

Copy link
Copy Markdown

Apologies didn't realize that replying to a thread that has someone tagged auto triggers. Thanks for bringing it to my attention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment