Selenium

Setting up Selenium Project in Eclipse

1. Create a MVN project

2. In Eclipse under preference set java version to JDK

3. Download chromedriver from https://chromedriver.storage.googleapis.com/index.html. If you are using windows, you can copy the web driver to the 'resource' folder of the project. Or https://github.com/mozilla/geckodriver/releases for firefox and others https://www.seleniumhq.org/download/ f

4. Edit pom.xml from the mvn project and add the following plugins and dependencies

Plugins

- maven-compiler-plugin

- maven-sunfire-plugin

Dependencies

- selenium-java

- selenium-remote-driver

- testng (framework for testing)

URLs:

Compiler plugin - https://maven.apache.org/plugins//maven-compiler-plugin/

Surefire plugin - https://maven.apache.org/surefire//maven-surefire-plugin/ and select TestNG

TestNg Dependency - http://mvnrepository.com/artifact/org.testng/testng

Selenium Java - https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java

5. Setup TestNg as default test suite

Create a folder say 'TestSuites' inside src/test/resources/

Create an test suite xml file. Get a example copy from http://testng.org/doc/documentation-main.html

6. In maven pom.xml update surefire configuration

<configuration>

<suiteXmlFiles>

<suiteXmlFile>${suiteXmlFile}</suiteXmlFile>

</suiteXmlFiles>

</configuration>

Property <suiteXmlFile>src/test/resources/TestSuites/LoginTestSuite.xml</suiteXmlFile>

7. Install TestNG plugin for eclipse.

Under Help, click marketplace and search for 'TestNG for eclipse'

8. Optionally if you want to run in command line using TestNG use

mvn clean test -DsuiteXmlFile=src/test/resources/TestSuites/LogInTestSuites.xml

9.

Automated Testing Clouds Vendors

SauceLabs -

Platform config can be found at wiki.saucelabs.com/display/DOCS/Platform+Configurator

BrowserStack

CrossBrowserTesting

SauceLabs - Configurations

Create Test suite - example at the below link

https://github.com/PacktPublishing/Mastering-Selenium-Webdriver-3.X-Test-Automation/blob/master/Section%205/V09132_05_05_Code_KS/src/test/resources/TestSuites/LogInTestSuiteVariousBrowsersSauce.xml

Framework for creating Testinging Environment

https://github.com/PacktPublishing/Mastering-Selenium-Webdriver-3.X-Test-Automation