The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:




Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> Micro Focus/Borland/Segue SilkPerformer

Pages: 1
pultosky
Member


Reged: 07/29/08
Posts: 39
Need Help on Scripting Java in SP
      #510297 - 08/20/08 09:15 PM

Hi,

i saw this function on silkperformer that allow one to create new java script;
(File >> new... > java script (.java) )

i'm really interested to know how this java script works? i appreciate any information or example from anyone, especially on how do i make use of it? =)


Post Extras: Print Post   Remind Me!   Notify Moderator  
moin1985
Newbie


Reged: 09/10/08
Posts: 2
Re: Need Help on Scripting Java in SP [Re: pultosky]
      #515895 - 09/10/08 05:27 AM

hi ... please go through programmer guide there u can see the total process and from recording to exe the test ,, r go through the www.borland.com there u can find .java acrobat file download it and check it all best

Post Extras: Print Post   Remind Me!   Notify Moderator  
James12222
Member


Reged: 02/06/08
Posts: 32
Re: Need Help on Scripting Java in SP [Re: moin1985]
      #516180 - 09/11/08 01:35 AM

Hello Pultosky,

First we have to create the java class for write the logic in functions

Write a Java class in Java.bdh
----------
import silk.performer.*;

public class UserDefindClass
{
private SilkPerformer silkPerformer = null;

/**
* @param perf SilkPerformer context object.
*/
public UserDefindClass(SilkPerformer perf)
{
silkPerformer = perf;
}

/**
* userDefindFunc function, that is called from BDL script.
*/
public void userDefindFunc() throws SilkPerformerException
{
if (silkPerformer != null)
silkPerformer.Print("Method \"Foo\" entered.");
silkPerformer.MeasureStart("Foo");
silkPerformer.MeasureStop("Foo");
}
}

-------------------------------------------
Now we have to call the function (userDefindFunc()) in the BDF script as follows.

benchmark UserDefindClass

use "Kernel.bdh"
use "Java.bdh"

// Definition of global variables: buffer handles, carrays, strings
var
homeDir : string;
hTestObj : number;

// Workload Section
dcluser
user
JavaUser
transactions
TInit : begin;
TMyJavaTrans : 1;
TEnd : end;

// Java Framework Transactions Section
dcltrans
transaction TInit
var
hPerf : number;
begin
JavaCreateJavaVM();

hPerf := JavaLoadObject("silk/performer/SilkPerformer");
JavaSetObject(JAVA_STATIC_METHOD, hPerf);
hTestObj := JavaLoadObject("UserDefindClass");
JavaFreeObject(hPerf);
end TInit;

transaction TMyJavaTrans
var
fValue : float;
begin
ThinkTime(0.2);
JavaCallMethod(hTestObj, "userDefindFunc");
end TMyJavaTrans;

transaction TEnd
begin
JavaFreeObject(hTestObj);
end TEnd;


Please let me know if you need any clarifications.
Thanks,
R@M


Post Extras: Print Post   Remind Me!   Notify Moderator  
pultosky
Member


Reged: 07/29/08
Posts: 39
Re: Need Help on Scripting Java in SP [Re: James12222]
      #516476 - 09/12/08 01:08 AM

Thanks for sharing Ramachandra2 =)

Post Extras: Print Post   Remind Me!   Notify Moderator  
pultosky
Member


Reged: 07/29/08
Posts: 39
Re: Need Help on Scripting Java in SP [Re: pultosky]
      #521211 - 10/01/08 10:34 AM

For the benefit of starters who wish to know more on setting up the java compiler to do java scripting in SP, you may find more information in the following post >> http://www.sqaforums.com/showflat.php?Cat=0&Number=520384&an=0&page=0#Post520384

Post Extras: Print Post   Remind Me!   Notify Moderator  
maxj
Active Member


Reged: 01/14/04
Posts: 825
Loc: UK
Re: Need Help on Scripting Java in SP [Re: pultosky]
      #521312 - 10/02/08 02:28 AM

This is a very good post.... can the MODERATOR please make this a sticky?

--------------------
I like what i know and I know what i like


Post Extras: Print Post   Remind Me!   Notify Moderator  
beam
Member


Reged: 06/25/07
Posts: 82
Loc: Sweden
Re: Need Help on Scripting Java in SP [Re: James12222]
      #587776 - 08/26/09 11:32 PM

R@M,

Please post your example in the sticky code sharing thread.

Regards,
beam

Edited by beam (08/26/09 11:33 PM)


Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 5 anonymous users are browsing this forum.

Moderator:  AJ, jamesso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 7259

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5