{"id":19113835,"url":"https://github.com/wndrr/seleniumutils","last_synced_at":"2025-02-22T11:45:57.055Z","repository":{"id":56450945,"uuid":"145555854","full_name":"Wndrr/SeleniumUtils","owner":"Wndrr","description":"A C#.NET Standard 2.0 collection of utility methods for Selenium Webdriver","archived":false,"fork":false,"pushed_at":"2023-12-15T08:49:03.000Z","size":17,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-04T07:37:14.681Z","etag":null,"topics":["csharp-library","net-standard-2","selenium","seleniumwebdriver"],"latest_commit_sha":null,"homepage":"https://www.nuget.org/packages/Wndrr.Selenium.Utils","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Wndrr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-21T11:41:22.000Z","updated_at":"2019-02-12T20:15:36.000Z","dependencies_parsed_at":"2024-11-09T04:39:16.343Z","dependency_job_id":"0d142882-57ce-4b37-8fa5-e0503dc54c2f","html_url":"https://github.com/Wndrr/SeleniumUtils","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wndrr%2FSeleniumUtils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wndrr%2FSeleniumUtils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wndrr%2FSeleniumUtils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wndrr%2FSeleniumUtils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wndrr","download_url":"https://codeload.github.com/Wndrr/SeleniumUtils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240170064,"owners_count":19759143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp-library","net-standard-2","selenium","seleniumwebdriver"],"created_at":"2024-11-09T04:39:12.012Z","updated_at":"2025-02-22T11:45:57.023Z","avatar_url":"https://github.com/Wndrr.png","language":"C#","readme":"# Selenium utils\nA C#.NET Standard 2.0 collection of utility methods for Selenium Webdriver\n\n## Compatibility\n\nThis library targets .NET Standard 2.0 which makes it compatible with both .NET Core 2.0 and above aswell as .NET Framework 4.6.1 and above. See the [compatibility page](http://immo.landwerth.net/netstandard-versions/#) for a more exhaustive list of compatible frameworks.\n\n## NuGet package\n\nThe NuGet package can be found on [NuGet.org](https://www.nuget.org/packages/Wndrr.Selenium.Utils/) or by searching `Wndrr.Selenium.Utils` in the NuGet explorer.\n\n## Usage\n\n### The `VerticalScrollTo` extension method\nReplaces the `ScrollTo` method\n\nTries to put an element in the center of the screen vertically using a javascript call to `window.scrollTo`.\nUsage example\n```csharp\n// Instanciate an IWebDriver\nusing (var driver = new ChromeDriver())\n{\n    // Find an element in the DOM (isn't \"dummyElement\" a very cute name for an ID ?)\n    var dummyElement = _driver.FindElement(By.Id(\"dummyElement\"));\n    // Scroll the element to the center of the window (more or less) \n    driver.VerticalScrollTo(dummyElement);\n}\n```\n\n### The `SwitchToTab` extension method\n\nChanges the focus of the `IWebDriver` to target the tab/window, finding it by its id.\nThe return value indicates if the tab could be found. When it is `false` no tab change occured.\n```csharp\n// Instanciate an IWebDriver\nusing (var driver = new ChromeDriver())\n{\n    // Focus to the 2nd tab\n    bool isSwitchSuccess = driver.SwitchToTab(1);\n}\n```\n\n### The `WaitUntilCurrentUrlChange` extension method\n\nPeriodically checks if the browser URL has changed. If no changes occured before the specified timeout occurs, a `TimeoutException` will be thrown.\n```csharp\n// Instanciate an IWebDriver\nusing (var driver = new ChromeDriver())\n{\n    // Will wait untill the URL changes using the default timeout (10s) and poll (.5s) time\n    driver.WaitUntilCurrentUrlChange();\n}\n```\n\n### The `WaitUntilUrlIs` extension method\n\nPeriodically checks if the browser URL is identical to the passed string. If the URL does not match before the specified timeout occurs, a `TimeoutException` will be thrown.\n```csharp\n// Instanciate an IWebDriver\nusing (var driver = new ChromeDriver())\n{\n    // Will wait untill the URL becomes https://request.url using the default timeout (10s) and poll (.5s) time\n    driver.WaitUntilUrlIs(\"https://request.url\");\n}\n```\n\n### The `WaitUntilUrlContains` extension method\n\nPeriodically checks if the browser URL contains the passed string. If the URL does not match before the specified timeout occurs, a `TimeoutException` will be thrown.\n```csharp\n// Instanciate an IWebDriver\nusing (var driver = new ChromeDriver())\n{\n    // Will wait untill the URL becomes https://request.url using the default timeout (10s) and poll (.5s) time\n    driver.WaitUntilUrlContains(\"/part/of/url?wololo=pouët\");\n}\n```\n\n### Legacy code\nThe `ScrollTo` was made obsolete. Use `VerticalScrollTo` instead.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwndrr%2Fseleniumutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwndrr%2Fseleniumutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwndrr%2Fseleniumutils/lists"}