Thursday, 24 November 2022

TestNG project check_user_name.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_User_Name extends Load_Test {

@BeforeTest
public void Before_User_name(){

}

@Test
public void Test_User_name(){
ExtentTest test4 = extent.createTest("Check User Name Text Box");
if(driver.findElement(By.id("user-name")).isDisplayed()){
if(driver.findElement(By.id("user-name")).isEnabled()){
test4.log(Status.INFO,"User Name TextBox is Displayed: Pass");
test4.log(Status.INFO, "User Name TextBox is Enabled: Pass");


extent.flush();

}
else{
test4.log(Status.INFO,"User Name TextBox is Displayed: Pass");
test4.log(Status.INFO,"User Name TextBox is Enabled: Failed");
extent.flush();
}
}
else{
test4.log(Status.INFO, "User Name TextBox is Displayed: Failed");
test4.log(Status.INFO, "User Name TextBox is Enabled: Failed");
extent.flush();
}
}

@AfterTest
public void After_user_name(){

}

}

--
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=""...