Skip to content

Instantly share code, notes, and snippets.

@executeautomation
Created October 3, 2016 12:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save executeautomation/d339d5ba35adeb46594fca1462d08957 to your computer and use it in GitHub Desktop.
Save executeautomation/d339d5ba35adeb46594fca1462d08957 to your computer and use it in GitHub Desktop.
Identifying broken links with Selenium C#
@TabishKhan21
Copy link

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

@karunakart
Copy link

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

@mhossen
Copy link

mhossen commented Dec 27, 2020

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
Copy link

karthik commented Dec 29, 2020

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

@mhossen
Copy link

mhossen commented Dec 29, 2020

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