Ich habe eine POM < /code> für die Seite 'Projekt erstellen' erstellt < /p>
public static class addProjInfo_container
{
public static WebElement ProjName_txt(WebDriver driver)
{
element=driver.findElement(By.xpath("//label[text()='Project Name']/following-sibling::input"));
return element;
}
// and so on for every text field for adding project...
< /code>
und Ich habe eine Testutilität < /code> mit Methode für WaitForELement < /code> wie unten angezeigt < /p>
erstellt.public final class TestUtility {
private static WebDriver driver;
public static void waitforElementXpath(final WebDriver driver,final int waitTime,final String xp)
{
WebDriverWait wait =new WebDriverWait(driver, waitTime);
wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(xp)));
}
}
< /code>
Jetzt möchte ich im Testskript vermeiden.TestUtility.waitforElementXpath(driver,10,CreateProject_Page.addProjInfo_container.projName_txt(driver));
< /code>
, aber es zeigt Fehler als < /p>
anThe method waitforElementXpath(WebDriver, int, String) in the type TestUtility is not applicable for the arguments (WebDriver, int, WebElement)
< /code>
Bitte lassen Sie mich wissen, wie das
Problem behandelt wird. < /p>