My code to Login to a page
@Test(testName = "Capturer", description = "A Capturer user")
public static void authenticate(String user,String password) {
try {
browser.get(Property.get("hostdnqa1"));
finesseType(formUserId, Property.get(user));
finesseType(formPassCode, Property.get(password));
CommonGcsdFunction.captureScreenshot("Login page");
finesseFind(buttonLogin).click();
CommonGcsdFunction.captureScreenshot("RTGS Web landing page");
} catch (Exception e) {
e.printStackTrace();
}
}
I need to highlight formUserId or formPassCode. If the password is wrong i want to highlight password field on the screenshort so that we can see where the problem is. The same goes for the user ID
Below is the code i use to take screen short:
public static void captureScreenshot(String screenshotName) {
try {
TakesScreenshot ts = (TakesScreenshot) browser;
File source = ts.getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(source, new File("./Screenshots/11FEBRUARY2022IT2/" + screenshotName + ".png"));
//logger.log(Level.INFO,"Screenshot taken");
} catch (Exception e) {
e.printStackTrace();
}
}//END Screenshot