• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JavaScript in JMeter

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,
In my application, there are certain link which calls some javascript functions. As JMeter can't process JavaScript(http://wiki.apache.org/jakarta-jmeter/JMeterFAQ - FAQ 20).
is this mean i have make seprate HTTP requests for each javascript funcition?
please help.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All you can do is make an HTTP request to a page which may include JavaScript. If the JavaScript is required to forward on the request then since JMeter doesn't include a JavaScript interpreter you just have to add arequest for each possible outcome.

Of courjse JMeter is open source, so if you feel like writing a JavaScript interpreter for it...
 
Raminder Singh
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks paul.
well let me expalin problem a bit more detail.
Page A has one Text field T1 and one link which is opening a new window thr java script.
on Page B(new popup) there is a list of city names. when i click any name on page B a javascipt function passCity('NYC') is called and pass NYC to textfield-T1 on page A and pageB closed. so how to trace route of NYC from page B->pageA in context of JMeter???
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Answer: you don't have to. There is no server request happening in that interaction so there is nothing for JMeter to profile. If you want to make a subsequent request from page A using the value you populated via the popup I'm afraid you can't since the value is populated through JavaScript which doesn't run in JMeter. Since JavaScript is client side though you could just make the request for the popup then submit page A incuding an arbitrary value - what JMeter will record would be the same even if the JavaScript had run.
reply
    Bookmark Topic Watch Topic
  • New Topic