I am trying to write a selenium test case which will be put on company jenkins server where all the employee will have access to every java files I create.
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://somesite.com");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
WebElement userName=driver.findElement(By.xpath(".//*[@id='username']"));
userName.clear();
userName.sendKeys("[email protected]");
WebElement password=driver.findElement(By.xpath(".//*[@id='password']"));
passwordclear();
password.sendKeys("password");
password.submit();
driver.quit();
What I want to do is not show the "password" there, I don't want other employees to see my password. Is there any way I can do that?
You could always encrypt it or base64 it or something so it isn't at least in plain text, but to be honest any sort of hardcoded password encryption can be reversed if they have / can see the source code.