How to call a method dynamically in Java
// Get the Class object of the class that contains the method Class<?> loginAction = LoginAction.class; // Get the Method object of the method you want to call Method actionMethod…
// Get the Class object of the class that contains the method Class<?> loginAction = LoginAction.class; // Get the Method object of the method you want to call Method actionMethod…
At first need to add necessary jar files to project. Then create a log4j2.xml file in your project's src/test/resources folder. The file appender is defined with a file name of…
F anmeL namePointsToihidI10Suchik20AtiyeK30
As the ID and class create dynamically so my best approce the xpath as bellow driver.findElement(By.xpath("//button[@data-cookiebanner='accept_button']")).click();
At first we have to import packages import org.openqa.selenium.support.ui.WebDriverWait; import org.openqa.selenium.support.ui.ExpectedConditions; 2. WebDriverWait wait =new WebDriverWait(driver,Duration.ofSeconds(5)); wait.until(ExpectedConditions.presenceOfElementLocated (By.xpath("/html/body/div[3]/div[2]/div")));