xwm1222 发表于 2006-11-15 13:15:23

如何才能使Robot在录制脚本时候能识别java控件

求助:
      如何才能使Robot在录制脚本时候能识别java控件,即能抓到JAVA控件的属性等内容!!
             急急急!!!
谢谢各位大虾!!

lana.li 发表于 2006-12-2 11:49:27

it can be recognized by default when i use it, such as editbox, dropdown box, button and so on, all of them can be recognized.(Web page)
Maybe the java object you mentioned is special in the web page
Here is some script, you can see some editbox andPushButton there.

Sub Main
    Dim Result As Integer

    'Initially Recorded: 12/2/200611:27:52 AM
    'Script Name: java object
   
    Window SetContext, "Class=Shell_TrayWnd", ""
    Toolbar Click, "ObjectIndex=2;\;ItemText=Launch Internet Explorer Browser", "Coords=8,10"
   
    Window SetContext, "Caption=about:blank - Microsoft Internet Explorer", ""
    Toolbar Click, "ObjectIndex=5;\;ItemID=33136", "Coords=42,13"
   
    Window SetContext, "Class=BaseBar", ""
    Toolbar Click, "ObjectIndex=1;\;ItemText=Osiris - Login Page", "Coords=52,13"
   
    Window SetContext, "Caption=Osiris - Login Page - Microsoft Internet Explorer", ""
    Browser NewPage,"HTMLTitle=Osiris - Login Page",""
    EditBox Click, "Name=gessouid", "Coords=33,9"
    InputKeys "1111"
    PushButton Click, "HTMLText=Login"
    Browser NewPage,"HTMLTitle=Home Page",""
    HTMLLink Click, "HTMLText=45613", ""
    Browser NewPage,"HTMLTitle=Job Information Database - Job Main",""
    HTML Click, "HTMLId=s1", "Coords=102,11"
    HTML Click, "HTMLId=s1-5", "Coords=30,10"
   
    Browser NewPage,"HTMLTitle=Job Information Database - Cell Leader Summary",""
    Result = HTMLLinkVP (CompareProperties, "HTMLId=Job Folder", "VP=Object Properties;Wait=2,30")
   
    Result = HTMLLinkVP (CompareProperties, "HTMLId=Job Currency", "VP=Object Properties2;Wait=2,30")
    Result = EditBoxVP (CompareProperties, "Name=txtCostReviewComment", "VP=Object Properties3;Wait=2,30")

End Sub

jumping_x 发表于 2006-12-5 13:04:17

要让Robot识别Java控件,是需要另外经过一道手续的:Java Enabler。
在开始->Rational Software->Rational Test菜单下你可以找到Java Enabler的快捷方式。运行,通常最好进行Complete搜索,在搜索到的结果中选择你会用到的JDK,之后等待Java Enabler完成注入。

当然这些操作必须在Robot不在运行时执行。执行完成后重新启动Robot就可以录制Java控件的操作,当然,要确保你的Java程序运行所使用的JDK被识别到。
页: [1]
查看完整版本: 如何才能使Robot在录制脚本时候能识别java控件