xpath - How to fill timepicker field with capybara -
i new capybara , have problems text field, capybara can not find field.
i need create automatic tests , 1 of them has fill in fields changes time(id , name changes, this: id="patterndailystart_146d7547140" , number different).
html part looks this:
<div class="timepicker"> <input value="" id="patterndailystart_146d7547140" name="patterndailystart_146d7547140" class="timepicker-input patterndailystart hasdatepicker" type="text"> <img class="ui-datepicker-trigger" src="/mpromoter/assets/4716a6a0a357181/app/components/timefield/clock.png" alt="..." title="..."> </div>
this time picking field. , problem capybara can not find field.. try find filling.
when try find xpath, found, when want fill in time($starttime=17:00) says element not found or not exist.
these xpaths found:
page.has_xpath?('//tbody/tr/div/input[contains(., "patterndailystart")]') page.has_xpath?(:xpath, "//*[@class='timepicker-input patterndailystart hasdatepicker']")
i tried fill in this:
and(/^fill fields$/) field = find("//*[@class='timepicker-input patterndailystart hasdatepicker'") field.set $starttime end
and this:
fill_in('timepicker-input.patterndailystart.hasdatepicker', :with => $starttime)
and this:
within(:xpath,'//tbody/tr/div/input[contains(., "patterndailystart")]'){ fill_in("#patterndailystart", with: $starttime)}
and many other ways still nothing fills in fields..
so asking help. have do, suggestions?
thank you... :)
i think easiest locate inputs 'patterndailystart' class:
find(:css, '.patterndailystart').set($starttime)
Comments
Post a Comment