Kuhtich / sfapi

Automatically exported from code.google.com/p/sfapi
0 stars 0 forks source link

doFlexProperty fails, throws exception #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Determine the id or uid of a page element using getFlexProperty().
2. Select a specific element property. In my case I used height.
3. Get the current value of the element  
4. Set the value of the element to a value that's known to be valid using
doFlexProperty().

What is the expected output? What do you see instead?
Expected result: The value of the element property will be set to the new
value.

Actual result: An exception is thrown. The element property is not set. The
text of the exception is below.

What version of the product are you using? On what operating system?
SFAPI version 0.26
Windows Server 2008 (64-bit). 
Java version "1.6.0_19"
Firefox version 3.6.3
Shockwave Flash version 10.0.45.2

Please provide any additional information below.

When I use FlexSpy I am able to update the height parameter with the new
value without error, so I'm pretty sure that the application under test
isn't to blame. 

I am unable to capture the Actionscript error. Instructions on how to
configure my project under Eclipse 3.3 to capture Actionscript errors would
be greatly appreciated.

Here is the code that provokes the issue. I've tried passing both the id
and the uid of the page element and I've tried prefixing the element with
"id=", "uid=" and no prefix at all. I've tried this with several page
elements with no success. The result is always the same. 

flashApp = new FlexUISelenium(selenium, "rex-1.0_alpha");

String appID = "rex-1.0_alpha"
String appID_h = "hirex-1.0_alpha.height";

String app_height = flashApp.call("getFlexProperty", appID, "height")
logger.debug("app_height = " + app_height); // works, app_height = "978"

try {
   set_app_height = flashApp.call("doFlexProperty", appID_h, "977");
} catch (Exception e) {
   logger.error("Exception during doFlexProperty with appID_h " + appID_h);
      e.getMessage();
      e.getCause();
      e.printStackTrace();
}

Exception message:
ERROR [main] (selFlexTwo.java:testAddTuningManagerDataCollector:427) -
Exception during get_accordion_height with adminView_ParentID accordion
com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception:
Error in Actionscript. Use a try/catch block to find error.
    at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrE
rror(HttpCommandProcessor.java:97)
    at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.ja
va:91)
    at
com.thoughtworks.selenium.HttpCommandProcessor.getString(HttpCommandProcessor.ja
va:262)
    at com.thoughtworks.selenium.DefaultSelenium.getEval(DefaultSelenium.java:443)
    at com.thoughtworks.selenium.FlashSelenium.call(FlashSelenium.java:57)
    at
selFlexTwo.selFlexTwo.testAddTuningManagerDataCollector(selFlexTwo.java:424)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:643)
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:559)
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:723)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1027)
    at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137
)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)
    at org.testng.TestRunner.runWorkers(TestRunner.java:953)
    at org.testng.TestRunner.privateRun(TestRunner.java:633)
    at org.testng.TestRunner.run(TestRunner.java:505)
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:316)
    at org.testng.SuiteRunner.run(SuiteRunner.java:195)
    at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:903)
    at org.testng.TestNG.runSuitesLocally(TestNG.java:872)
    at org.testng.TestNG.run(TestNG.java:780)
    at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:75)
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:127)

Original issue reported on code.google.com by logan.hawkes@gmail.com on 27 Apr 2010 at 7:59

GoogleCodeExporter commented 8 years ago
Addendum: 

String appID = "rex-1.0_alpha"
String appID_h = "hirex-1.0_alpha.height";

Should be:

String appID = "rex-1.0_alpha"
String appID_h = "rex-1.0_alpha.height";

Original comment by logan.hawkes@gmail.com on 27 Apr 2010 at 8:26