For login page: I need to login with username
and password
, I should pass the password in encrypted format. While so I would need to save the password encrypted in test data. While sending password to that field I should decrypt and send that in selenium script.
it is necessary. Any secret key or password must be encrypted with any logic.
Security is the most important thing. Password should be in encrypted form. Cross-browser: How to perform cross browser testing
Anybody please help me to perform password encryption and multiple browser configuration:
package util;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
/**
* Created by naveen on 29/11/16.
*/
public class DriverManager {
public static WebDriver driver;
String baseUrl="http://qmsadm/";
public DriverManager()
{
System.setProperty("webdriver.chrome.driver","/home/naveen/chromedriver");
driver=new ChromeDriver();
driver.get(baseUrl);
driver.manage().window().maximize();
}
}
package login;
import org.testng.annotations.*;
import org.testng.Assert;
import pageobjects.HomePage;
import steps.LoginSteps;
import util.DriverManager;
public class loginTest2
{
@BeforeSuite(groups = {"regression"})
public void initDriver(){
DriverManager manager = new DriverManager();
}
@Parameters({"userName","password"})
@Test
public void verifyValidLogintoSpree(String userName, String password)
{
LoginSteps loginSteps = new LoginSteps();
HomePage expected_message=loginSteps.Login(userName,password);
Assert.assertEquals(expected_message,"MY ACCOUNT");
}
}
testng.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Regression">
<parameter name="userName" value="geosony"/>
<parameter name="password" value="1"/>
<test name="regression">
<groups>
<run>
<include name="regression"/>
<exclude name="sanity"/>
</run>
</groups>
<classes>
<class name="login.loginTest"/>
</classes>
</test>
</suite>