0

In the website I'm testing, I create a new customer. Once this customer is created a new id is assigned for that customer, which is not stored as a form field in the customer webpage but rather on the top page as pure text like (Customer 601619 - name1)

I have this html tag

<h1> Customer 601619 - name1 </h1>

My question is how to retrieve this customer id using Java selenium RC

Thanks in advance

Harshavardhan Konakanchi
  • 4,238
  • 6
  • 36
  • 54

1 Answers1

0

Use the following code

String str = seleniumobj.getText("//h1");
System.out.println(str);

The above code prints Customer 601619 - name1 in console

Harshavardhan Konakanchi
  • 4,238
  • 6
  • 36
  • 54