简体   繁体   English

无法通过UFT / QTP在JavaObject上设置/选择日期

[英]Unable to Set/Select Date on JavaObject through UFT/QTP

I am trying to set date on a Java Application. 我正在尝试在Java应用程序上设置日期。 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") 绿色部分为: 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. 我尝试对1和2使用“选择”,“单击”,但是没有用。 Also tried use SendKeys method (Just in case) didn't work either. 也尝试过使用SendKeys方法(以防万一)也不起作用。 I'm out of ideas on what i would do to achieve this. 我对实现此目标的想法一无所知。 Appreciate any help here 感谢这里的任何帮助

The issue is that you have a generic JavaObject instead of a JavaCalendar object. 问题是,你有一个通用的Java对象 ,而不是一个JavaCalendar对象。 So, you won't benefit of JavaCalendar specific methods like "SetDate" which will select a specific date. 因此,您将不会受益于JavaCalendar特定的方法,例如“ SetDate”,它将选择一个特定的日期。

Have you tried to do a record and see the UFT's output? 您是否尝试做记录并查看UFT的输出?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM