• 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

test url of a link using jwebunit

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a jsp file which has the following link...

<a href="i42/index.jsp">Trial</a>

I have to test the URL value i.e. "i42/index.jsp" in my jwebunit test case.

Any help is appreciated!!

TIA
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vinitha,
What do you have so far? For example, do you have a JWebUnit test that goes to a main page?
 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jeanne,
my test case goes to the main page, tests for authentication of user, and also the page's content. The page has 5 links, all of which are to external applications. Hence, clickLinkWithText() fails. But, I am required to test for the correctness of the link.

Thanks,
vini
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by vinitha simon:
The page has 5 links, all of which are to external applications. Hence, clickLinkWithText() fails.


So the clickLinkWithText() fails because the links are pointing to a URL which isn't accessible from your computer? Unfortunately, the JWebUnit API is missing a lot of useful assertions like assertLinkPresentWithUrl(String). What you could do is implement your own assertions by parsing the raw HTML content returned by getPageSource().
reply
    Bookmark Topic Watch Topic
  • New Topic