0 Replies Latest reply on Jun 28, 2010 5:06 AM by pgpradeep

    Automation for DataGrid in SDK 3.5

    pgpradeep Level 1

      Hi,

       

      I am writing an automation agent for Flex (record and playback agent).

      I have successfully written record and plaback code for most components including TextInput,Button,VSlider,HSlider,CheckBox,ColorPicker,ComboBox, DateChooser, DateField,LinkButton,NumericStepper,PopUpButton,RadioButton,RichTextEditor,TextArea and Tree.

       

      For DataGrid, I am stuck.For example I am trying to set table cell data.For this I have rowIndex,ColumnIndex, textToBeSet as input arguments(args). For this I am doing the following:

       

      var

       

      rowIndex:int = parseInt(args[0].toString());

       

      var colIndex:int = parseInt(args[1].toString());

      var

       

      inputString:String = args[2].toString();

      var

       

      columnName:String = perform(autmObject,"gettablecolumnname",colIndex);//********custom function

      //**********that returns a column name given columnIndex. AutmObject is the current IAutomationObject, DataGrid in this case

      var

       

      part:AutomationIDPart = new AutomationIDPart();

       

      var text:String = columnName + ":" + rowIndex.toString();

      part.automationIndex = text;

       

      var aObjectArray:Array = automationManager.resolveIDPart(autmObject, part);

      var

       

      delegate:IAutomationObject = (aObjectArray[0] as IAutomationObject);

       

      if (delegate)

      {

       

      var rid:AutomationID = automationManager.createID(delegate);

       

      var textObject:IAutomationObject = automationManager.resolveIDToSingleObject(rid);//basically similar to delegate

      textObject.replayAutomatableEvent(

      new TextEvent(TextEvent.TEXT_INPUT,false,false,inputString);// ********actually I tried using creating

      // ***********an event("flash.events.TextEvent") and object(autmObject) and then populate the event["text"] and pass it to

      // **********automationManager.replayAutomatableEvent(repEvent) where repEvent:AutomationReplayEvent = new AutomationReplayEvent();

      //***********the same as in AutoQuick,but it boils down to the same line of code.

      }

       

      But when I execute textObject.replayAutomatableEvent(new TextEvent(TextEvent.TEXT_INPUT,false,false,inputString), nothing happens, but it returns true.

       

      Can someone from the automation team please help me out?

       

      Thanks,

      Pradeep.