Password encoder for Selenium Webdriver

By using this Password encoder, we can secure the password.Its so simple to Encrypt.

import java.util.Base64;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
public class PasswordEncryptor {
WebDriver driver;
static String decodepassword=”aGFwcHltYW4xNjM=”;
public static String getDecodedpassword()
return new String(Base64.getDecoder().decode(decodepassword.getBytes()));

public void test1()
driver=new FirefoxDriver();
driver.findElement(“Email”)).sendKeys(“[email protected]”);



5 thoughts on “Password encoder for Selenium Webdriver

  1. Anonymous June 3, 2015 / 12:46 pm

    This is cool !!


  2. armatearjun June 15, 2015 / 12:53 pm

    What is the java version supported for base64, if i try importing import java.util.Base64; import cannot be resolved error is coming, so tried using instead import org.apache.commons.codec.binary.Base64;, but no luck, i am using JRE7 in buildpath… Any help will be appreciated…


    • charan163 June 15, 2015 / 2:47 pm

      I am using JAVA- version 8

      Liked by 1 person

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s