mVermaat / Crm.Specflow

D365 Extension for SpecFlow allows you to automatically test your Dynamics 365 CE implementation. It provides a broad set of SpecFlow steps to help you create your scripts very rapidly. It leverages the EasyRepro library from Microsoft for the User Interface related tests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to set time value for datetime control

thathi opened this issue · comments

Unable to set time value some times.

image

Hoping after setting the date field if we clear the focus maight help.

@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.