{"id":22363095,"url":"https://github.com/lambdatest/specflow-selenium-sample","last_synced_at":"2025-07-30T15:31:07.347Z","repository":{"id":38363802,"uuid":"255224129","full_name":"LambdaTest/SpecFlow-Selenium-Sample","owner":"LambdaTest","description":"Run test automation on cloud with SpecFlow and LambdaTest. This is a sample repo to help you execute SpecFlow framework based test scripts in parallel with LambdaTest automation testing cloud","archived":false,"fork":false,"pushed_at":"2022-06-16T13:06:58.000Z","size":51581,"stargazers_count":11,"open_issues_count":1,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2023-03-27T17:27:56.383Z","etag":null,"topics":["lambdatest","selenium","selenium-tests","selenium-webdriver","specflow","test-automation","testing","testing-tools","web-testing"],"latest_commit_sha":null,"homepage":"https://www.lambdatest.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LambdaTest.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-13T03:40:10.000Z","updated_at":"2023-03-27T17:27:56.384Z","dependencies_parsed_at":"2022-08-24T14:11:38.714Z","dependency_job_id":null,"html_url":"https://github.com/LambdaTest/SpecFlow-Selenium-Sample","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FSpecFlow-Selenium-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FSpecFlow-Selenium-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FSpecFlow-Selenium-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LambdaTest%2FSpecFlow-Selenium-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LambdaTest","download_url":"https://codeload.github.com/LambdaTest/SpecFlow-Selenium-Sample/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228154024,"owners_count":17877704,"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":["lambdatest","selenium","selenium-tests","selenium-webdriver","specflow","test-automation","testing","testing-tools","web-testing"],"created_at":"2024-12-04T17:13:36.585Z","updated_at":"2024-12-04T17:13:37.209Z","avatar_url":"https://github.com/LambdaTest.png","language":"C#","readme":"# Run Selenium Tests With SpecFlow On LambdaTest\r\n\r\n![image](https://user-images.githubusercontent.com/70570645/171986341-572a87c2-3855-4e19-a710-36909cb51e2d.png)\r\n\r\n\u003cp align=\"center\"\u003e\r\n  \u003ca href=\"https://www.lambdatest.com/blog/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample\" target=\"_bank\"\u003eBlog\u003c/a\u003e\r\n  \u0026nbsp; \u0026#8901; \u0026nbsp;\r\n  \u003ca href=\"https://www.lambdatest.com/support/docs/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample\" target=\"_bank\"\u003eDocs\u003c/a\u003e\r\n  \u0026nbsp; \u0026#8901; \u0026nbsp;\r\n  \u003ca href=\"https://www.lambdatest.com/learning-hub/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample\" target=\"_bank\"\u003eLearning Hub\u003c/a\u003e\r\n  \u0026nbsp; \u0026#8901; \u0026nbsp;\r\n  \u003ca href=\"https://www.lambdatest.com/newsletter/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample\" target=\"_bank\"\u003eNewsletter\u003c/a\u003e\r\n  \u0026nbsp; \u0026#8901; \u0026nbsp;\r\n  \u003ca href=\"https://www.lambdatest.com/certifications/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample\" target=\"_bank\"\u003eCertifications\u003c/a\u003e\r\n  \u0026nbsp; \u0026#8901; \u0026nbsp;\r\n  \u003ca href=\"https://www.youtube.com/c/LambdaTest\" target=\"_bank\"\u003eYouTube\u003c/a\u003e\r\n\u003c/p\u003e\r\n\u0026emsp;\r\n\u0026emsp;\r\n\u0026emsp;\r\n\r\n*Learn how to use SpecFlow framework to configure and run your C# automation testing scripts on the LambdaTest platform*\r\n\r\n[\u003cimg height=\"58\" width=\"200\" src=\"https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png\"\u003e](https://accounts.lambdatest.com/register?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n\r\n## Table Of Contents\r\n\r\n* [Pre-requisites](#pre-requisites)\r\n* [Run Your First Test](#run-your-first-test)\r\n* [Parallel Testing With SpecFlow](#running-your-parallel-tests-using-specflow)\r\n* [Local Testing With SpecFlow](#testing-locally-hosted-or-privately-hosted-projects)\r\n\r\n\r\n## Prerequisites\r\n\r\n**Note:** This tutorial is specifically for Windows users using **Microsoft Visual Studio**.\r\n\r\nBefore you can start performing **SpecFlow** automation testing with **Selenium**, you would need to:\r\n\r\n* Download and Install **Selenium WebDriver** from the [official website](https://www.selenium.dev/downloads/).\r\n* Make sure you work with latest version of **SpecFlow**.\r\n* **.Net** framework to deliver guidelines while developing a range of application using C#.\r\n* Download [Selenium WebDriver Language Binding](https://www.selenium.dev/downloads/) for C# and extract them to appropriate folder. A [.NET Core SDK](https://dotnet.microsoft.com/en-us/download) of 2.1 or greater version.\r\n\r\n### Installing Selenium Dependencies And Tutorial Repo\r\n\r\n**Step 1:** Clone the LambdaTest’s SpecFlow-Selenium-Sample repository and navigate to the code directory as shown below:\r\n\r\n```csharp\r\ngit clone https://github.com/LambdaTest/SpecFlow-Selenium-Sample\r\ncd SpecFlow-Selenium-Sample\r\n```\r\n### Setting Up Your Authentication\r\n\r\nMake sure you have your LambdaTest credentials with you to run test automation scripts with C#. You can get these credentials from the [LambdaTest Automation Dashboard](https://automation.lambdatest.com/login?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample) or by your LambdaTest Profile.\r\n\r\n**Step 2:** Set LambdaTest **Username** and **Access Key** in environment variables.\r\n\r\n* For **Linux/macOS**:\r\n  \r\n  ```bash\r\n  export LT_USERNAME=\"YOUR_USERNAME\" \r\n  export LT_ACCESS_KEY=\"YOUR ACCESS KEY\"\r\n  ```\r\n  * For **Windows**:\r\n  ```bash\r\n  set LT_USERNAME=\"YOUR_USERNAME\" \r\n  set LT_ACCESS_KEY=\"YOUR ACCESS KEY\"\r\n  ```\r\n## Run Your First Test\r\n\r\n\u003e**Test Scenario**: The below sample script TodoAppSteps.cs tests a sample to-do list app by marking couple items as done, adding a new item to the list and finally displaying the count of pending items as output.\r\n\r\n**Step 3:** In the test script [TodoAppSteps.cs](https://github.com/LambdaTest/SpecFlow-Selenium-Sample/blob/master/Step%20Defination/TodoAppSteps.cs), you need to update your test capabilities. In this code, we are passing browser, browser version, and operating system information, along with LambdaTest Selenium grid capabilities via capabilities object. The capabilities object in the above code are defined as:\r\n\r\n```csharp \r\nDesiredCapabilities capabilities = new DesiredCapabilities();\r\n            capabilities.SetCapability(CapabilityType.BrowserName, \"Chrome\");\r\n            capabilities.SetCapability(CapabilityType.Version, \"96\");\r\n            capabilities.SetCapability(CapabilityType.Platform, \"Windows 10\");\r\n```\r\nYou can generate capabilities for your test requirements with the help of our inbuilt [Desired Capability Generator](https://www.lambdatest.com/capabilities-generator/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample).\r\n\r\n### Executing Your First Test \r\n\r\n**Step 4:** Build the solution by clicking in **Build \u003e Build Solution.** \r\n\r\n**Step 5:** As shown below click on **Test Explorer** on your MS Visual Studio:\r\n\r\n\u003cimg height=\"300\" src= \"https://user-images.githubusercontent.com/70570645/171986691-f41b3082-9cf8-4863-91f4-bb77538d15c8.png\"/\u003e\r\n\r\n**Step 6:** Click on **Run** from the Test Explorer to run the sample test as shown below:\r\n\r\n\u003cimg height=\"300\" src= \"https://user-images.githubusercontent.com/70570645/171986838-fd229e7e-29ff-41b7-8476-28eb17efee6a.png\"/\u003e\r\n\r\nYour results would be displayed on the test console and on the LambdaTest dashboard. [LambdaTest Dashboard](https://automation.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample) will help you view all your text logs, screenshots and video recording for your entire Selenium tests.\r\n\r\n## Running Your Parallel Tests Using SpecFlow\r\n\r\nTo run parallel tests, you may go to **Test Explorer** on Visual Studio as mentioned above and click on **Run All** tests to execute the tests. \r\n\r\n## Testing Locally Hosted Or Privately Hosted Projects\r\n\r\nYou can test your locally hosted or privately hosted projects with LambdaTest Selenium grid using LambdaTest Tunnel. All you would have to do is set up an SSH tunnel using tunnel and pass toggle `tunnel = True` via desired capabilities. LambdaTest Tunnel establishes a secure SSH protocol based tunnel that allows you in testing your locally hosted or privately hosted pages, even before they are live.\r\n\r\nRefer our [LambdaTest Tunnel documentation](https://www.lambdatest.com/support/docs/testing-locally-hosted-pages/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample) for more information.\r\n\r\nHere’s how you can establish LambdaTest Tunnel.\r\n\r\nDownload the binary file of:\r\n* [LambdaTest Tunnel for Windows](https://downloads.lambdatest.com/tunnel/v3/windows/64bit/LT_Windows.zip)\r\n* [LambdaTest Tunnel for macOS](https://downloads.lambdatest.com/tunnel/v3/mac/64bit/LT_Mac.zip)\r\n* [LambdaTest Tunnel for Linux](https://downloads.lambdatest.com/tunnel/v3/linux/64bit/LT_Linux.zip)\r\n\r\nOpen command prompt and navigate to the binary folder.\r\n\r\nRun the following command:\r\n\r\n```bash\r\nLT -user {user’s login email} -key {user’s access key}\r\n```\r\nSo if your user name is lambdatest@example.com and key is 123456, the command would be:\r\n\r\n```bash\r\nLT -user lambdatest@example.com -key 123456\r\n```\r\nOnce you are able to connect **LambdaTest Tunnel** successfully, you would just have to pass on tunnel capabilities in the code shown below :\r\n\r\n**Tunnel Capability**\r\n\r\n```java\r\nDesiredCapabilities capabilities = new DesiredCapabilities();        \r\n        capabilities.setCapability(\"tunnel\", true);\r\n```\r\n\r\n## Tutorials 📙\r\n\r\nCheck out our latest tutorials on SpecFlow automation testing 👇\r\n\r\n* [SpecFlow Tutorial For Automation Testing With Selenium C#](https://www.lambdatest.com/blog/specflow-tutorial-for-automation-testing/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n* [Understanding SpecFlow Framework and Running Tests on Cloud Selenium Grid](https://www.lambdatest.com/blog/specflow-tutorial-for-automation-testing/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n* [How To Perform Parallel Execution With Specflow, NUnit, And Selenium](https://www.lambdatest.com/blog/parallel-execution-with-specflow-nunit-and-selenium/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n\r\n\r\nFor video tutorials on Selenium SpecFlow, please refer to our [SpecFlow Tutorial Playlist](https://www.youtube.com/playlist?list=PLZMWkkQEwOPmE8w1NjEmTrbRSmPokMG9L). ▶️\r\n\r\nSubscribe To Our [LambdaTest YouTube Channel 🔔](https://www.youtube.com/c/LambdaTest) and keep up-to-date on the latest video tutorial around software testing world.\r\n\r\n## Documentation \u0026 Resources :books:\r\n\r\n      \r\nVisit the following links to learn more about LambdaTest's features, setup and tutorials around test automation, mobile app testing, responsive testing, and manual testing.\r\n\r\n* [LambdaTest Documentation](https://www.lambdatest.com/support/docs/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n* [LambdaTest Blog](https://www.lambdatest.com/blog/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n* [LambdaTest Learning Hub](https://www.lambdatest.com/learning-hub/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)    \r\n\r\n## LambdaTest Community :busts_in_silhouette:\r\n\r\nThe [LambdaTest Community](https://community.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample) allows people to interact with tech enthusiasts. Connect, ask questions, and learn from tech-savvy people. Discuss best practises in web development, testing, and DevOps with professionals from across the globe 🌎\r\n\r\n## What's New At LambdaTest ❓\r\n\r\nTo stay updated with the latest features and product add-ons, visit [Changelog](https://changelog.lambdatest.com/) \r\n      \r\n## About LambdaTest\r\n\r\n[LambdaTest](https://www.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample) is a leading test execution and orchestration platform that is fast, reliable, scalable, and secure. It allows users to run both manual and automated testing of web and mobile apps across 3000+ different browsers, operating systems, and real device combinations. Using LambdaTest, businesses can ensure quicker developer feedback and hence achieve faster go to market. Over 500 enterprises and 1 Million + users across 130+ countries rely on LambdaTest for their testing needs.    \r\n\r\n### Features\r\n\r\n* Run Selenium, Cypress, Puppeteer, Playwright, and Appium automation tests across 3000+ real desktop and mobile environments.\r\n* Real-time cross browser testing on 3000+ environments.\r\n* Test on Real device cloud\r\n* Blazing fast test automation with HyperExecute\r\n* Accelerate testing, shorten job times and get faster feedback on code changes with Test At Scale.\r\n* Smart Visual Regression Testing on cloud\r\n* 120+ third-party integrations with your favorite tool for CI/CD, Project Management, Codeless Automation, and more.\r\n* Automated Screenshot testing across multiple browsers in a single click.\r\n* Local testing of web and mobile apps.\r\n* Online Accessibility Testing across 3000+ desktop and mobile browsers, browser versions, and operating systems.\r\n* Geolocation testing of web and mobile apps across 53+ countries.\r\n* LT Browser - for responsive testing across 50+ pre-installed mobile, tablets, desktop, and laptop viewports\r\n\r\n    \r\n[\u003cimg height=\"58\" width=\"200\" src=\"https://user-images.githubusercontent.com/70570645/171866795-52c11b49-0728-4229-b073-4b704209ddde.png\"\u003e](https://accounts.lambdatest.com/register?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n\r\n## We are here to help you :headphones:\r\n\r\n* Got a query? we are available 24x7 to help. [Contact Us](mailto:support@lambdatest.com)\r\n* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github\u0026utm_medium=repo\u0026utm_campaign=specflow-selenium-sample)\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fspecflow-selenium-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flambdatest%2Fspecflow-selenium-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flambdatest%2Fspecflow-selenium-sample/lists"}