Unable to set time value for datetime control
thathi opened this issue · 3 comments
@thathi You state this happens sometimes. Can you elaborate it a little bit when it happens?
@mVermaat I think its timing issue around finding the timeField element. For me its always failing. If I wait in debug mode for few seconds it is working as expected. Either we can do clearfocus after setting date field or waitfewseconds before finding time element would do. Hope this make sense.
// Try Set Time
var timeFieldXPath = By.XPath($"//div[contains(@data-id,'{field}.fieldControl._timecontrol-datetime-container')]/div/div/input");
bool success = driver.TryFindElement(timeFieldXPath, out var timeField);
Makes sense, I'll run some tests soon to see how it works and ill accept the pull request if I don't see any issues.