1
votes

I just want to read the value from this page and compare with the value I have in my test case. The value (email address) is constantly changing and I have selenium ide case that test if the email is the same or not. If the email is the same the test should pass and if not the test will failed.

HTML element value I am trying to read:

<input id="DERIVED_HR_FL_EMAIL_ADDR" class="ps-edit" type="text" value="[email protected]" maxlength="70" disabled="disabled" title="Email Address">

I tried to use the Id and verify value but I'm getting this message.

error message

It seem that the selenium IDE is not reading the value form the webpage and it's saying "undefined".

2
Could you include the code snippet that you are running in Selenium IDE which produces this error? - CEH
It's possible this is not working because your input element has disabled=disabled set. Selenium cannot always read text from disabled elements. - CEH

2 Answers

0
votes

You can store the value from your input element like this:

<tr>
  <td>storeAttribute</td>
  <td>xpath=//input[@id='DERIVED_HR_FL_EMAIL_ADDR']@value</td>
  <td>x</td>
</tr>
0
votes

Below example for By.id

// Get the WebElement corresponding to the Email Address(TextField)     
        WebElement email = driver.findElement(By.id("email"));
        String str_Email = email.gettext();