|
|
|
[
Permlink
| « Hide
]
Vivek Prahlad - 06/Mar/07 04:24 AM
It looks like the problem is caused due to a select_list event before the assert_enabled event. Could you post a portion of the test script with a couple of lines before and after the assert_enabled line?
Hi, this is the script:
activate_window "Portfolio Breakdown Selection Thu 25 Jan 2007" edit_table_cell "JTable_2" , "0,1" click_checkbox "2" , "false" stop_table_edit "JTable_2" assert_enabled "JTable_2" edit_table_cell "JTable_2" , "0,1" click_checkbox "2" , "true" stop_table_edit "JTable_2" assert_enabled "JTable_2" When I remove the assert_enabled events, the script loads. However when I press play I get the following errors: INFO: 03/07/2007 09:48:01 AM Playing: ActivateWindowEvent: Portfolio Breakdown Selection Thu 25 Jan 2007 INFO: 03/07/2007 09:48:01 AM Playing: EditTableCellEvent: Table: JTable_2 cell: (0,1) INFO: 03/07/2007 09:48:01 AM Playing: CheckboxEvent: 2, selected: false WARNING: 03/07/2007 09:48:01 AM Exception: Unable to find component with name: 2 in au.com.macquarie.fmg.des.trading.DimensionFrame[frame0,0,0,646x645,invalid,layout=java.awt.BorderLayout,title=Portfolio Breakdown Selection Thu 25 Jan 2007,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,22,640x620,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] com.thoughtworks.frankenstein.playback.DefaultComponentFinder.findComponent(DefaultComponentFinder.java:35) com.thoughtworks.frankenstein.events.CheckboxEvent.run(CheckboxEvent.java:48) com.thoughtworks.frankenstein.events.EventExecutionStrategy$2.execute(EventExecutionStrategy.java:17) com.thoughtworks.frankenstein.events.AbstractFrankensteinEvent.play(AbstractFrankensteinEvent.java:86) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.play(DefaultScriptContext.java:87) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.playEvents(DefaultScriptContext.java:80) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.play(DefaultScriptContext.java:69) com.thoughtworks.frankenstein.recorders.DefaultRecorder.run(DefaultRecorder.java:101) java.lang.Thread.run(Thread.java:534) INFO: 03/07/2007 09:48:01 AM Playing: StopTableEditEvent: Table: JTable_2 INFO: 03/07/2007 09:48:01 AM Playing: EditTableCellEvent: Table: JTable_2 cell: (0,1) INFO: 03/07/2007 09:48:01 AM Playing: CheckboxEvent: 2, selected: true WARNING: 03/07/2007 09:48:01 AM Exception: Unable to find component with name: 2 in au.com.macquarie.fmg.des.trading.DimensionFrame[frame0,0,0,646x645,invalid,layout=java.awt.BorderLayout,title=Portfolio Breakdown Selection Thu 25 Jan 2007,normal,defaultCloseOperation=DO_NOTHING_ON_CLOSE,rootPane=javax.swing.JRootPane[,3,22,640x620,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=385,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true] com.thoughtworks.frankenstein.playback.DefaultComponentFinder.findComponent(DefaultComponentFinder.java:35) com.thoughtworks.frankenstein.events.CheckboxEvent.run(CheckboxEvent.java:48) com.thoughtworks.frankenstein.events.EventExecutionStrategy$2.execute(EventExecutionStrategy.java:17) com.thoughtworks.frankenstein.events.AbstractFrankensteinEvent.play(AbstractFrankensteinEvent.java:86) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.play(DefaultScriptContext.java:87) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.playEvents(DefaultScriptContext.java:80) com.thoughtworks.frankenstein.recorders.DefaultScriptContext.play(DefaultScriptContext.java:69) com.thoughtworks.frankenstein.recorders.DefaultRecorder.run(DefaultRecorder.java:101) java.lang.Thread.run(Thread.java:534) INFO: 03/07/2007 09:48:02 AM Playing: StopTableEditEvent: Table: JTable_2 Also, I dont have ruby installed. All I have done is add the Frankenstein jars into the classpath. Thanks, George. It looks like there are two separate issues.
a) I would strongly recommend running those steps via the ruby driver. The ruby folder contains an example.rb file that shows how to put a test together in Runy. The assert_enabled API has to be executed from the Ruby side. Most assertions are converted to an intermediate OGNL form that the java runtime can understand. Here's a workaround: replace assert_enabled "JTable_2" with assert "JTable_2" "enabled:true" (This is the OGNL expression that the Frankenstein Java runtime receives from from the Ruby driver when the assert_enabled function is called) b) The exception you're seeing is a bug, I'm taking a look at it right now. I've got a potential fix for the second issue checked into subversion. There's a change that will allow checkboxes within tables to be named in a better way. When you record your script, the check box click step should now show up as
click_checkbox "<column_name_without_spaces>", "true" instead of click_checkbox "<1/2/3/etc.>", "true" Could you please check whether this works for you? In case you'd rather wait for a release, I'm planning the next release for early next week. Fixed, please reopen in case the fix doesn't work for you.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||