Ach so, ok.
Ich bin einen Schritt weiter, aber noch nicht ganz zufrieden.
So siehts gerade aus:
[CODE lang="java" title="Assert Equals"]String[] xpathParts = new WebDriverWait(driver, Duration.ofSeconds(120, 1)).until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//span[contains(., 'Your user name is: ')]"))).getText().split(" ");
Assert.assertEquals("Nachname1, Vorname1 (Nummer)", xpathParts[4] + " " + xpathParts[5] + " " + xpathParts[6]);
System.out.println("Kontrollausgabe Assert Equals Name: " + xpathParts[4] + " " + xpathParts[5] + " " + xpathParts[6]);[/CODE]
Ich weiß nicht wie ich aus diesem String in meinem nun erstellten Script ab dem Freizeichen vom Doppelpunkt bis zum Schluss den String packe und vergleiche.
"Your user name is: Nachname1, Vorname1 (Nummer)"
AssertEquals also ab "Nachname1, Vorname1 (Nummer)", das als ganzes vergleichen und nicht in Stücke gerissen.