Forum Discussion

Nayak_Ragh's avatar
Nayak_Ragh
Occasional Contributor
4 years ago

How to extract the data from the ObjectProperty

 

 

I have spied on an object using 'Set Variable Value' assigning it to a new variable (Var1). Its value is  Aliases.Ax32.Purchase_order.TaskPageLayout.PartHostSplitContainer.SplitterPanel.NativeWindowControl.NativeWindowWithEvents.PurchTable.AxTabCtrl.AxPaneWnd.AxPaneWnd.Cable_Assembly_Llc.Value

 

Now I need to extract the content of this 'Value' at the end, split it and extract particular data.

 

Could you please advise how to achieve this?

This is a desktop application and my operation is to capture the ID generated, to be used as an input for further testing.

  • This is the code I used and it worked for me

    var obj = aqObject.GetPropertyValue(Aliases.Ax32.Purchase_order.TaskPageLayout.PartHostSplitContainer.SplitterPanel.NativeWindowControl.NativeWindowWithEvents.PurchTable.AxTabCtrl.AxPaneWnd.AxPaneWnd.Cable_Assembly_Llc, "Value");

    var objValue = aqConvert.VarToStr(obj);

    var obj1 = objValue.split(":");

    var objFirst = obj1[0];

    Log.Message(objFirst);


  • Nayak_Ragh wrote:

     

     

    I have spied on an object using 'Set Variable Value' assigning it to a new variable (Var1). Its value is  Aliases.Ax32.Purchase_order.TaskPageLayout.PartHostSplitContainer.SplitterPanel.NativeWindowControl.NativeWindowWithEvents.PurchTable.AxTabCtrl.AxPaneWnd.AxPaneWnd.Cable_Assembly_Llc.Value

     

    This Var1 should contain the value that you want.  Now apply aqString as needed to that variable and save that to a new variable so you can see the result without losing the original value.

    • Nayak_Ragh's avatar
      Nayak_Ragh
      Occasional Contributor

      This is the code I used and it worked for me

      var obj = aqObject.GetPropertyValue(Aliases.Ax32.Purchase_order.TaskPageLayout.PartHostSplitContainer.SplitterPanel.NativeWindowControl.NativeWindowWithEvents.PurchTable.AxTabCtrl.AxPaneWnd.AxPaneWnd.Cable_Assembly_Llc, "Value");

      var objValue = aqConvert.VarToStr(obj);

      var obj1 = objValue.split(":");

      var objFirst = obj1[0];

      Log.Message(objFirst);

  • ok so you grabbed the value (I'm assuming string) , what does the full string look like

    what are the delimiters? how would you distinguish that something is an ID number? is it always the same number of digits? 

     

    you are going to have to script some sort of a string concatenation function... maybe with more info someone in the community can help you out 🙂