Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HTTPunit and java script

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am writing a test which has following steps

Get a page - this is successful

Simulate click of an image on the page.- when i look at the source code of the page it basically means executing a javscript function

javascript:listControl_VignConsoleForm.toolBar.actions[10].actionHandler("commonimagestoolbaraddgifSite_VignConsoleForm")


How do I simulate this?

appreciate any help
 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Would the following do ?



If you want to emulate a click on an image, you can always get the link associated to it by using something like webResponse.getLinkWithName("linkName"). You'll see from WebResponse's API javadoc that you can make use of several link-related methods for this purpose. Just google for "WebResponse API".
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic