This is the HTML code : <input placeholder="Early" value="Oct 4, 2023" xpath="1">
My test wanna verify if the value of this field is equal with the actual date time. I have The actual date time function maded but i dont know how can i extract this field .
This is the locator of the field :
"firstDateField" : "//input[contains(placeholder,Early)]/following-sibling::div"
I have tried with regex but it doenst work :
* def extractedValue = karate.replace(text, '.*Early.+value=\\"([A-Za-z]+ \\d{1,2}, \\d{4}).*', '$1')
* print 'Extracted value:', extractedValue