Skip to content

the-engineers-site/webdriver-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Travis Build Status Maven Central

WebDriver Helper

WebDriver Helper Extensions is designed to simplify Java based Selenium/WebDriver tests. It's built on top of Selenium/WebDriver to make your tests more readable, reusabable and maintainable by providing easy handling towards browser and advance identifiers.

Available through the Maven Central Repository! Latest release is version 1.2.1 which includes selenium-java 3.14 as a transitive dependency.


What's included in this utility?

  • Browser handling ( interaction towards all the available browsers)
  • Advanced selenium identifiers which can help you for rapid developement.
  • Advanced way to manage driver executables for each env(ubuntu/mac/windows) Webdrivermanager
  • Muti browser support.

Want to Contribute?

If you find a bug or have a feature request please create a new GitHub issue or even better clone this repository, commit your changes and make a Pull Request.


Have any Questions?

If you have question you can ask them in a GitHub issue.


Content


Hello World Example

Here is an example of how a cross browser test looks like with and without the WebDriver Extensions Framework. The test will run on Firefox, Chrome and Internet Explorer. It will google for "Hello World" and assert that the search result contains the searched text "Hello World".

Sample Project

config file

BROWSER_TYPE=ch
BASE_URL=https://opensource-demo.orangehrmlive.com/
IMPLICIT_WAIT=10
DEBUG_MODE=true

With WebDriver Extensions

class ExampleTestCases {
 @Test
    public void validationMessagePassword() {
        ElementActions.type("User Name", "Admin");
        ElementActions.click("Login");
        String errorMessage = ElementActions.getText("Error Message");
        Assert.assertEquals(errorMessage, "Password cannot be empty");
    }


    @Test
    public void validationMessageUser() {
        ElementActions.clear("User Name");
        ElementActions.sendKeys("Password", "admin123");
        ElementActions.click("Login");
        String errorMessage = ElementActions.getText("Error Message");
        Assert.assertEquals(errorMessage, "Username cannot be empty");
    }
}

Imports are hidden for the sake of simplicity, for imports and instructions on how to run this example see this gist


Debug Mode

 System.setProperty("DEBUG_MODE", "true");

Once you enable debug mode every action will be displayed with toast message as well as element will be highlighted. Demo Video Can be seen here.


Version History:

ChangeLog

License

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages