2

I'm facing an issue with SetCellData in my Java Application for an JavaTable.

Note: Manually also user is not able to edit in a single click. User has to double click than only he will be able to edit/update.

Recorded Lines example:-

JavaWindow("abc").JavaTable("def").ActivateRow "#0"
JavaWindow("abc").JavaTable("def").SetCellData "#0","Wait to Restore (sec)","0"

Code:-

JavaWindow(aq).JavaTable(o_table).ActivateRow "#0"
JavaWindow(aq).JavaTable(o_table).SetCellData "#0","Wait to Restore (sec)", wait_time

But It is still not working as expected. Kindly help.

Edit 1: Also tried with ClickCell, DoubleClickCell. But still not working. Kindly let me know what else i can try or if i missing something.

Edit 2: Spy object

TheMightyNight
  • 161
  • 1
  • 2
  • 13
  • 1
    The cell where you want to set the data, Can you do the object spy on that **cell** and post the screenshot here? I just want to see if that **cell** has a childobject on which we can perform double click operation. My idea is make a generic object(corresponding to a x,y cell) using the descriptive programming and perform the click/double click operation on that object before setting the data. – Gurmanjot Singh Sep 26 '17 at 09:59
  • @Gurman Last object i can spy is JavaTable. Currently I'm trying the same. I've used DoubleClickCell and then trying to paste the value but the earlier value is still present. Tryting to delete using below code but stucked here too. Have a look at the below code. `JavaWindow(node).JavaTable(otn_table).Type micEnd + micShiftDwn + micHome + wait_time` – TheMightyNight Sep 26 '17 at 10:34
  • As Gurman asked, pls post the screenshot of object spy window for that Jaava table. – ManishChristian Sep 26 '17 at 12:40
  • @ManishChristian done. I have added image for the first time so don't know if there is any other better way. – TheMightyNight Sep 26 '17 at 12:53
  • Is there any error that you are getting when you perform this action...? – ManishChristian Sep 26 '17 at 13:55
  • @ManishChristian Error getting in question asked is "Failed to run the test due to an unknown error." For the workaround It's just appending string not replacing. – TheMightyNight Sep 27 '17 at 07:18
  • @TheMightyNight - Have you tried using native java `setValueAt` method? – Pankaj Jaju Sep 27 '17 at 10:09
  • What all add-ins you are loading? – ManishChristian Sep 27 '17 at 13:12
  • @PankajJaju: tried `setValueAt` and it throws runtime error with msg `"The operation cannot be performed"`. Also don't think JavaTable support this function. Do let me know if more inputs required from my side. – TheMightyNight Oct 26 '17 at 07:06
  • @ManishChristian: ActiveX, Java, Visual Basic and Web. Do let me know if more inputs required. – TheMightyNight Oct 26 '17 at 07:08
  • @TheMightyNight - As i said its native Java function so you have to use `yourjavatable.Object.setValueAt` – Pankaj Jaju Oct 26 '17 at 07:51
  • @PankajJaju: Sorry if i'm being naive. What i tried is `JavaWindow(aq).JavaTable(o_table).Object.setValueAt name, 0, 1` and it throws error `Object doesn't support this property or method: JavaWindow(...).JavaTable(...).Object.setValueAt` – TheMightyNight Oct 26 '17 at 08:24
  • @TheMightyNight - Something like `Call JavaWindow("PricingSheet").JavaTable("DataTable").Object.setValueAt("Wait to Restore (sec)",51,1)` - this function takes three values - *data to be set, row, column*. Make sure that you are using correct row and col values else it will throw object doesnt support error – Pankaj Jaju Oct 26 '17 at 11:09

1 Answers1

-1

You have extra quotes on the last line for the first parameter.

JavaWindow(aq).JavaTable(o_table).SetCellData **""#0"**,"Wait to Restore (sec)", wait_time

Adelin
  • 7,809
  • 5
  • 37
  • 65
mada
  • 67
  • 1