# Cannot set value for datepicker

**URL:** <https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368>\
**Category:** Mobile Testing\
**Tags:** mobile-testing, katalon-studio\
**Created:** [March 23, 2020, 7:27am UTC](https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368 "2020-03-23T07:27:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tuan.NguyenHuu](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@Tuan.NguyenHuu](https://forum.katalon.com/u/Tuan.NguyenHuu)\
**Post date:** [March 23, 2020, 7:27am UTC](https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368/1 "2020-03-23T07:27:52Z")

</div>

Hi all,  
I am trying set value for datepicker below. I have tried with setText() and sendKeys() but they did not work.  
Hope I can receive a solutions or examples from everyone  
Thanks a lot!

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/3/3b5fe37c05a11fc787c25505a9aa226342a122f1.png)

---

<div class="post-metadata">

**Author:** ![mohammad.arif](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@mohammad.arif](https://forum.katalon.com/u/mohammad.arif)\
**Post date:** [March 23, 2020, 8:53am UTC](https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368/2 "2020-03-23T08:53:22Z")

</div>

Hi Tuan.NguyenHuu,  
Are you trying to set this on a Mobile environment? It looks like a spinner so I guess you could use the Swipe command followed by Verify Element Visible for the number you are after and then Tap on that element.

---

<div class="post-metadata">

**Author:** ![Tuan.NguyenHuu](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@Tuan.NguyenHuu](https://forum.katalon.com/u/Tuan.NguyenHuu)\
**Post date:** [March 23, 2020, 9:30am UTC](https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368/3 "2020-03-23T09:30:57Z")

</div>

Hi mohammad,  
Thank for reply,  
Yes, I am trying to set this on a Mobile environment. I have used a solution similar to your idea but I used Scroll instead of Swipe. However, it was unstable, sometime failed. So I want to find a new solution and example

---

<div class="post-metadata">

**Author:** ![mohammad.arif](https://avatars.discourse-cdn.com/v4/letter/m/df705f/32.png) [@mohammad.arif](https://forum.katalon.com/u/mohammad.arif)\
**Post date:** [March 24, 2020, 9:26am UTC](https://forum.katalon.com/t/cannot-set-value-for-datepicker/41368/4 "2020-03-24T09:26:43Z")

</div>

I see what you mean by unstable. Never nice to have flaky tests. You could try adding some checks via if statements until you get the number you desire - it’s not the best solution but I guess a solution none the less? Good luck
