0

Please, anyone can help me to find the right XPath to retreive the date value "07/05/2018 04:45"

<input type="text" id="startDate" name="myDate" value="07/05/2018 04:45" class="field1 center" onclick="pickDate(this,$PT('startDate'));" onkeydown="if (window.event.keyCode==13) return false;">

I've tried without succeed:

/input[@type="text"]@value

//*[@id="startDate"]

adavide
  • 15
  • 3

2 Answers2

1

I would first suggest using one of these methods to verify you're able to select the right item: How to verify an XPath expression in Chrome Developers tool or Firefox's Firebug?

Then try this:

//*[@id='startDate']/@value
millerdrew
  • 26
  • 4
0

You can locate element from Id or any attribute like,

//input[@value='07/05/2018 04:45'] 

OR

//input[@id='startDate']

As according to your Binding language, you can retrieve value from getAttribute submethod something like

(above locator).getAttribute("value")

So defined locator will locate and it will get value of inner attribute from attribute name "value" which you want to achieve.

Hope it will help you to retrieve it.

Ishita Shah
  • 3,955
  • 2
  • 27
  • 51