?????嵥 2. ??????????????ó?????

/* Parse the Top Level Test Object to the corresponding test object type based
 * on the domain name that was set
 */

TestObject myDomain;

if (myDomainName.equalsIgnoreCase("Html.HtmlBrowser")) {
 myDomain = (BrowserTestObject)
   returnTO(".class"?? "Html.HtmlBrowser");
}
else if (myDomainName.equalsIgnoreCase("Html.Dialog")) {
 myDomain = (TopLevelTestObject)
   returnTO(".class"?? "Html.Dialog");
}
else if (myDomainName.equalsIgnoreCase("javax.swing.JDialog")) {
 myDomain = (TopLevelTestObject)
   returnTO(".class"??"javax.swing.JDialog");
}
else if (myDomainName.equalsIgnoreCase("javax.swing.JFrame")) {
 myDomain = (TopLevelTestObject)
   returnTO(".class"?? "javax.swing.JFrame");
}
else if (myDomainName.equalsIgnoreCase
  ("com.ibm.retail.rma.res.ui.config.MasterAgentInfoDlg")) {
 myDomain = (TopLevelTestObject)
   returnTO(".class"??
   "com.ibm.retail.rma.res.ui.config.MasterAgentInfoDlg");
}

/* This function returns the 1st instance of a test object based on the
 * recognition property and the property value provided.  If the test object
 * is not found null will be returned.
 */
public TestObject returnTO(String recognitionProperty??
                            String recognitionPropertyValue??) {
 
 RootTestObject rTO = getRootTestObject();
 TestObject[] TOs = rTO.find(atDescendant(recognitionProperty?? propValue));
 TestObject returnTO = null;
 int numOfObjects = TOs.length;
 if (numOfObjects >= 1)
  returnTO = TOs[0];
 
 return returnTO;
}

?????????????????????????????????????????? find() API ????????????????????????????á???????????д???????????ú??????ú????????????????????嵥 3 ?е??????????????????ж???????? setText ????????????ó??????? HTML??Java??.NET?????????????λ???????漼?????κ????????ú???????Ч??

?????嵥 3. ??????? setText() ????

public boolean setTextGuiTestObject(TestObject myDomain??
                    String recognitionProperty??
                    String recognitionPropertyValue??
                    String valueToSet) {
 boolean status = true;
 
 try {
  TestObject[] TOs = null;
  TOs = myDomain.find(atDescendant
    (recognitionProperty?? recognitionPropertyValue));
  int numOfObjects = TOs.length;

  if (numOfObjects >= 1) {
   
   TextGuiTestObject myGTO1 = null;
  
   myGTO1 = (TextGuiTestObject) TOs[0];
   myGTO1.waitForExistence(2500?? 0.10);
   if (myGTO1.exists()) {
    System.out.println("Setting Text: " + valueToSet);
    myGTO1.click();
    myGTO1.setText(text);
   }
  }
  myGTO1.unregister();
 }
 catch (Exception e) {
  System.out.println("Unable to set Text :: " + e.toString());
  status = false;
 }
 return status;
}

??????????У??ú?????а????κ???ó?????????????????? Text Box ??????ó??????????????????????????ú???????????????????????????????????????????????????????κ??????????????????