I am trying to finish a test script written in Java
. Everything works great and I am trying to print out a confirmation if all previous steps runs which says that account creation was successful.
To do this, I have put the element in a string and then print out the element using the System.out.println
command. But for some reason , all I am getting is the following
CONFIRMATION:
That's it. It's supposed to show the string text which reads " Customer information added successfully" . I been trying for the past 2 hours to get it to print it. Can someone please help ?
Here's my code that's causing the problem.
String conf = driver.findElement(By.id("MainContent_lblTransactionResult")).getText();
System.out.println("CONFIRMATION: " + conf);
I have checked and rechecked the element id and it is the correct element id.
https://i.stack.imgur.com/pAmxH.jpg ( Confirmation page )
https://i.stack.imgur.com/Rt4t2.jpg ( Eclipse output )