Thursday, 24 November 2022

TestNG Project check_page_info.java file

package ExtentReports;

import com.aventstack.extentreports.ExtentTest;
import com.aventstack.extentreports.Status;
import org.openqa.selenium.By;
import org.testng.annotations.AfterTest;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

public class Check_Password_Box extends Load_Test{

@BeforeTest
public void before_pass(){

}
@Test
public void Test_pass(){
ExtentTest test5 = extent.createTest("Check Password TextBox");
if(driver.findElement(By.id("password")).isDisplayed()){
if (driver.findElement(By.id("password")).isEnabled()){
test5.log(Status.INFO,"Check password TextBox is Displayed: Pass");
test5.log(Status.INFO,"Check Password textBox is Enabled: Pass");
extent.flush();
}
else {
test5.log(Status.INFO, " Check password TextBox is Displayed: Pass");
test5.log(Status.INFO, " Check password TextBox is Enabled: Failed");
extent.flush();
}
}
else{
test5.log(Status.INFO, " Check password TextBox is Displayed: Failed");
test5.log(Status.INFO, "Check password TextBox is Enabled: Failed");
extent.flush();
}
}

@AfterTest
public void after_pass(){

}
}

--
With Warm REGARDS,

En. S. WANKHEDE

No comments:

Post a Comment

Welcome, happy learning

Charactor_At_Position

public class Char_At_Position { public static void main(String[] args) { String str = "Wankhede"; String rev=""...