SPONSORS:






User Tag List

Results 1 to 2 of 2
  1. #1
    Senior Member
    Join Date
    Jul 2001
    Location
    Westford, MA, USA
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Record Classes not seeing public methods in Java applet

    This is a serious stumper and probably requires that you know some Java.

    Problem: SilkTest's Record Classes picks up our "ignored" public Java custom classes MenuPanel and ButtonPanel, but fails to see any public properties or methods within those classes.

    Product: SilkTest 5.03 / 5.5
    Platform: Windows NT 4.0
    Internet Explorer 5.0/5.5
    CLASSPATH is set to SilkTest_Java1.jar
    Java applet developed w/ JDK 1.1.8 (not that it matters, probably)

    I believe our SilkTest setup to be correct because we have successfully exposed methods of other ignored classes in other applets authored at our company. We set our CLASSPATH variable; selected a browser in Options - Runtime - Default browser; added extend\explorer.inc to Options - Runtime - Use Files; enabled the extension via Extension Enabler as well as via Options - Extensions in the SilkTest main app; commented out our earlier declarations of these classes as well as the corresponding lines in javaex.ini; deleted all object files; and rebooted the Agent, SilkTest, and the browser.

    We are generally recording with the Record - Class - Show all classes box checked.

    Here's what the inc file and javaex.ini file had in them (again, we commented these out to do a fresh Record Class). The inc file, along with the other inc files in our harness, is compiled at startup via use statements in startup.inc.

    inc file:

    [-] winclass LotusNotesAppsActionbarMenuPanel : Control
    [ ] tag "[lotus.notes.apps.actionbar.MenuPanel]"
    [ ]
    [-] winclass LotusNotesAppsActionbarButtonPanel : Control
    [ ] tag "[lotus.notes.apps.actionbar.ButtonPanel]"

    javaex.ini file:

    [ClassList]
    lotus.notes.apps.actionbar.MenuPanel=true
    lotus.notes.apps.actionbar.ButtonPanel=true

    Following is an excerpt from our ActionBar.java file. I need to be able to record getNumButtons and getButtonCaption.
    ---------------------------
    package lotus.notes.apps.actionbar;

    import java.awt.*;
    import java.applet.*;
    import java.net.*;
    import java.util.*;
    import java.awt.event.*;

    public class ActionBar extends Applet implements ActionListener {
    // ETC . . .
    }

    class MenuPanel extends Panel implements Runnable {
    // ETC . . .
    }

    class ButtonPanel extends Panel {
    Action[] actions = null;

    // ETC . . .
    public int getNumButtons() {
    // ETC . . .
    }

    public String getButtonCaption(int i) {
    // ETC . . .
    }
    }
    ----------------------------
    I even tried keying the methods into the inc file, even though Record Class didn't see them. When I try to execute the script, however, I get an error in my results file:
    [ ] *** Error: The specified method is inaccessible or undefined

    One last thing that we tried, to no avail -- we moved class ButtonPanel to its own file, ButtonPanel.jar. No go. It doesn't seem to me that the lack of the "public" keyword before ButtonPanel should be significant -- the class should be public anyway, as far as I know.

    Any takers?

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

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Westford, MA, USA
    Posts
    160
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Record Classes not seeing public methods in Java applet

    We found the problem -- it's a bug in the SilkTest_java1.jar file (might be in the java2.jar file, too; haven't looked). There's a line in the file:

    if(!Modifier.isPublic(obj.getClass().getModifiers( )))

    which, instead of checking to see if the class is public, merely looks for the "public" keyword. This is a particularly bad practice considering that Java classes are public by default.

    So if you are having the same problem we had, ask your developer to add the "public" keyword.

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

 

 

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 04:04 AM.

Copyright BetaSoft Inc.