Wie konvertiere ich das Webelement in Selen mit Java in String in Selen? Bitte bezieht sich auf den Detailabschnitt für

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie konvertiere ich das Webelement in Selen mit Java in String in Selen? Bitte bezieht sich auf den Detailabschnitt für

by Anonymous » 20 Aug 2025, 17:09

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>

Top