Unable to Set/Select Date on JavaObject through UFT/QTP

本小妞迷上赌 提交于 2019-12-11 17:19:45

问题


I am trying to set date on a Java Application. below is the image

  1. The part in red is as :

    JavaDialog("tagname:=DialogM").JavaList("index:=2")

  2. The part in Green is as : JavaDialog("tagname:=DialogM").JavaObject("tagname:=JCalendarField\$DayList", "Index:=0")

I've tried rather vainfully to set date here. I tried using "select", "click" with 1 and 2 and it didn't work. Also tried use SendKeys method (Just in case) didn't work either. I'm out of ideas on what i would do to achieve this. Appreciate any help here


回答1:


The issue is that you have a generic JavaObject instead of a JavaCalendar object. So, you won't benefit of JavaCalendar specific methods like "SetDate" which will select a specific date.

Have you tried to do a record and see the UFT's output?



来源:https://stackoverflow.com/questions/47325964/unable-to-set-select-date-on-javaobject-through-uft-qtp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!