Thursday, 24 November 2022

TestNG Project check_menu_button.java file

package ExtentReports;

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

import java.util.List;

public class Check_Menu_Button extends Load_Test{

@BeforeTest
public void before_menu(){

}

@Test
public void test_Menu_Button(){
ExtentTest menu_test = extent.createTest("Menu_Button Test");

try{
driver.findElement(By.id("react-burger-menu-btn")).click();
List<WebElement> listelement = driver.findElements(By.className("bm-item-list"));
for (int i=0; i<listelement.size();i++){
menu_test.log(Status.INFO,"Menu: "+listelement.get(i).getText());
extent.flush();
}
menu_test.log(Status.INFO,"Menu List Check");
extent.flush();
}
catch (Throwable t){
System.out.println("Menu bar Exceptions: "+t);

}
}

@AfterTest
public void after_menu(){

}


}

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