SPONSORS:






User Tag List

Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Apr 2001
    Location
    Scotts Valley, CA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Error attempting to run native methods for 3rd party Java control

    Silk discovers the native methods in my 3rd party Java class, (and yes, I do feel lucky to have got so far given the crappy Silk documentation on this subject) but when I try to use some of them in a test script, it complains that they don't exist!

    The specific error I get is "The specified method is inaccessible or undefined" which is nuts because it already discovered them when I recorded the class. I KNOW they exist, I can see them in the winclass declaration.

    What's really odd is that it's fine with some methods but not others! E.g I wrote a test method that just returns a string, and I can call it with no problems. But when I try to use a method that accepts an integer as an argument, and also returns a string, Silk gives me the error message I described above. So what's up with that? Don't forget, both the methods are native and were successfully 'seen' by Silk and inserted into the winclass declaration.

    Print(a.b.c.getDummy()) <-works fine
    Print(a.b.c.getDummy2(7)) <-causes error

    ...both methods are seen by Silk when I recorded the class in the first place.


    Gosh, any help from you good folks out there would be a big help

    BTW: I have been using Silk for 5 years. I love it, but I do think their TS is barely adequate for non-Java, and terrible for Java.

    I'd be so grateful for any advice.


    ------------------

  2. #2
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    It's kind of unrelated, but I am interested to know how did you get the InvokeJava() to work with your java class?

    ------------------

  3. #3
    Junior Member
    Join Date
    Apr 2001
    Location
    Scotts Valley, CA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    I am not using InvokeJava() yet, because getDummy() and getDummy(int x) which I described above use simple data types, ie return Strings and accept integer argument, and can therefore by called as if they are a native method of SilkTest for that class. Indeed they are listed as such when the class gets recorded (i.e they DON'T get prefixed by //)
    However, those methods were intended to be just tests to prove that it can be done (which currently it can't hence my original post). I will eventually have to call a chain of methods involving complex data types, and for that I will use InvokeJava(). I'm happy to share the Java and 4Test code when I get it all working.

    ------------------

  4. #4
    Junior Member
    Join Date
    Apr 2001
    Location
    Scotts Valley, CA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    Well I got it working.
    I tried again on a Win2000 PC instead of NT, and it all worked perfectly the first time. I can see (i.e record) all the methods in the 3rd party java class, and I can easily call the native methods directly from 4Test.
    It is very frustrating though, to have no explanation for why it didn't work originally.

    ------------------

  5. #5
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    I'm VERY interested in seeing how you got this to work. I'm wrestling with some similar issues involving custom methods in Java classes.


  6. #6
    Junior Member
    Join Date
    Apr 2001
    Location
    Scotts Valley, CA
    Posts
    16
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    Well I thought everything was fine then my developer came along with a new method to try, and wouldn't you believe it, as soon as I tried to use the method, I got the same error as I described in my initial post.
    BUT !!!
    I solved the problem. And here is the answer... you must not use the _ character in Java method names that you will call from Silk. Yep it sounds ridiculous but it's true, at least in my bitter experience. All the methods that Silk was refusing to call had the _ character in the name. As soon as I removed the _ character from the name, recompiled the Java, re-recorded the class, and called them from natively from 4TEST, they worked perfectly.
    I emailed my findings to Silk TS. I'll put their reply here !
    When I have more time I'll post my code examples (Java and 4Test) as a reply to this topic.

    ------------------

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Bellingham, WA USA
    Posts
    1,323
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    I will look forward to your samples.

  8. #8
    Junior Member
    Join Date
    Apr 2001
    Posts
    14
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error attempting to run native methods for 3rd party Java control

    Hey Bugboy,

    Can you please post the code samples of the working Java and 4 test..

    Thanks in advance

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 05:33 PM.

Copyright BetaSoft Inc.