I am using Seleninun+Java+Cucumber+Junit in my project. There is a feature that i need to automate it. It is about time setting. There is a time input box. User can type the time by manually in this format: "22:00 pm". I used one parameterize step in my feature file. I send the time as String. But while it was written, the text is changing like that "am :0022". And also this format is not stabil. it changes every time. That's why i am not able to assert the time. I don't know how can i handle tis issue?
I tried to use String manipulation but it did not work
This is my scenario
Then click and clear event start hour and type manually "22:00 am"
This is my code
Actions actions = new Actions(Driver.getDriver());
actions.clickAndHold(eventPage.startTime).moveToElement(eventPage.startDate).sendKeys(Keys.BACK_SPACE).perform();
actions.sendKeys(hour).perform();
}
This is html code:
<input id="feed_cal_event_from_timecal_3Jcl" name="TIME_FROM_" type="text" value="" size="6" title="Select start date and time" autocomplete="off">
<script>
function bxLoadClock_feed_cal_event_from_timecal_3Jcl(callback)
{
if (!window.JCClock && !window.jsUtils)
{
return setTimeout(function(){bxLoadClock_feed_cal_event_from_timecal_3Jcl(callback);}, 50);
}
if (!window.JCClock)
{
if(!!window.bClockLoading)
{
return setTimeout(function(){bxLoadClock_feed_cal_event_from_timecal_3Jcl(callback);}, 50);
}
else
{
window.bClockLoading = true;
return BX.load(
[
'/bitrix/js/main/clock.js?154877654922135',
'/bitrix/themes/.default/clock.css?15487765656522'
],
function() {bxLoadClock_feed_cal_event_from_timecal_3Jcl(callback)}
);
}
}
window.bClockLoading = false;
var obId = 'bxClock_feed_cal_event_from_timecal_3Jcl';
window[obId] = new JCClock({
step: 5,
initTime: '',
showIcon: false,
inputId: 'feed_cal_event_from_timecal_3Jcl',
iconId: 'feed_cal_event_from_timecal_3Jcl_icon',
zIndex: 0,
AmPmMode: false,
MESS: {
Insert: 'Set Time',
Close: 'Close',
Hours: 'Hours',
Minutes: 'Minutes',
Up: 'Increase (Up)',
Down: 'Decrease (Down)'
}
});
return callback.apply(window, [window[obId]]);
}
function bxShowClock_feed_cal_event_from_timecal_3Jcl(id)
{
bxLoadClock_feed_cal_event_from_timecal_3Jcl(function(obClock)
{
obClock.Show(id);
});
}
</script>