# Mailosaur and Selenium - Quickstart guide Get Mailosaur up and running within your Selenium project in a few steps. ## What you'll need - You'll need a Mailosaur account. If you don’t already have one, just [create a free trial account](/app/signup) first. - Log in to your account and generate an [API key](/app/keys), as you will need this to run automated tests. - Finally, make sure you know how to send emails (or SMS) into your account. ## Express: Generate a sample project If you have **npm** installed, then the quickest way to get started is by generating a basic starter project for Selenium via the command line: ```sh npm create mailosaur@latest ``` This will give you a simple Selenium project with Mailosaur already configured, along with some basic tests so you can see how a project would typically work. You can also check out similar [sample code](https://github.com/mailosaur/examples/tree/main/selenium) on GitHub. ## Integrate with an existing Selenium project If you have an existing Selenium project (or created one just now), here is how to install and configure Mailosaur's API client library: ### Install the Mailosaur Java library **Gradle users** can add this dependency to their project’s build file: ```java // MAILOSAUR_JAVA_VERSION available at: // https://github.com/mailosaur/mailosaur-java/releases/latest) implementation "com.mailosaur:mailosaur-java:MAILOSAUR_JAVA_VERSION" ``` **Maven users** should add this dependency to their project’s POM: ```xml com.mailosaur mailosaur-java MAILOSAUR_JAVA_VERSION ``` If you don’t use Gradle or Maven, refer to the README within the [GitHub repository](https://github.com/mailosaur/mailosaur-java). ### Make your first API call ```java // Replace API_KEY with the one from your account var mailosaur = new MailosaurClient("API_KEY"); // Make a simple API call to find the name of your inbox var result = mailosaur.servers().list(); System.out.println("Inbox name is " + result.items().get(0).name()); ``` ### Install the Mailosaur Python library Run this command to install the [Mailosaur Python package](https://github.com/mailosaur/mailosaur-python): ```sh pip install mailosaur ``` ### Make your first API call ```py # Replace API_KEY with the one from your account mailosaur = MailosaurClient("API_KEY") # Make a simple API call to find the name of your inbox result = mailosaur.servers().list() print("Inbox name is " + result.items[0].name) ``` ### Install the Mailosaur .NET library Run this command to install the [Mailosaur NuGet package](https://github.com/mailosaur/mailosaur-dotnet): ```sh dotnet add package mailosaur ``` ### Make your first API call ```dotnet // Replace API_KEY with the one from your account var mailosaur = new MailosaurClient("API_KEY"); // Make a simple API call to find the name of your inbox var result = mailosaur.Servers.List(); Console.WriteLine("Inbox name is " + result.Items[0].Name); ``` ### Install the Mailosaur Ruby library Run this command to install the [Mailosaur Ruby package](https://github.com/mailosaur/mailosaur-ruby): ```sh gem install mailosaur ``` ### Make your first API call ```ruby # Replace API_KEY with the one from your account mailosaur = Mailosaur::MailosaurClient.new("API_KEY") # Make a simple API call to find the name of your inbox result = mailosaur.servers().list() puts("Inbox name is " + result.items[0].name) ``` ### Install the Mailosaur Node.js library Use **npm** to install the [Mailosaur Node.js library](https://github.com/mailosaur/mailosaur-node): ```sh npm install mailosaur ``` ### Make your first API call ```js // Replace API_KEY with the one from your account const MailosaurClient = require("mailosaur"); const mailosaur = new MailosaurClient("API_KEY"); // Make a simple API call to find the name of your inbox const result = await mailosaur.servers().list(); console.log("Inbox name is " + result.items[0].name); ``` ## Start testing Now that you have a project connected to the Mailosaur API, you can start creating all kinds of tests: - [Email testing](/docs/automation/selenium/email-testing) - test password resets, account verification, order confirmations, etc. - [SMS testing](/docs/automation/selenium/sms-testing) - test alerts, notifications, and 2FA logins - [2FA app testing](/docs/authenticator) - mimic the functionality of apps like Google Authenticator and Auth0 - [Email deliverability testing](/docs/api)