• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Selenium/Fitnesse and JSP

 
Sachin Dere
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,
I need to test an internal WebSite using Fitnesse/Selenium. Most of the pages in the Website are written in JSF and I am not able to test even the Login Page.When the Login Page is loaded by Selenium, i cannot login even when i do it manually. Is there any problem? Can Fitnesse/Selenium test JSF pages?
please help
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It would help if you could describe why you cannot, for example, log in.

I have heard of JSF creating dynamic ID attribute values for the HTML elements it generates, which obviously screws up any test automation approach based on identifying elements by their IDs but, if this is the source of your problems, I've also heard that the Tomahawk extensions to MyFaces would allow you to use fixed IDs. I've never used that stuff myself, though, so it's just hear-say.
 
Ben Blanchard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having the same problem. When the login page (which is a JSP file) gets loaded, Selenium appears to open it, but just hangs. Trying to send further commands to that session on the command line results in:

INFO - Got result: ERROR: got a null result on session #####


In my python script, all commands after the "open" don't get executed, as the script hangs on the open command (even though it looks like the page gets fully loaded).

However, if I:
1) start selenium
2) open a new tab and point it the login page
3) login (a cookie gets saved so that new windows on the same session don't have to login)
4) tell selenium to go to the main page (which now bypasses the login page)
5) try to type stuff/test things

It works fine, as far as I can tell. But that isn't something I want to go through every time I try to run a test script. Anyone know of any Selenium/JSP errors that might be tripping the login page up? (Oddest thing is, other pages on the site use JSP, but selenium can load them just fine.)

Not sure if this is even the right place to be asking, so I thought I'd check. If you need more information, please ask.

Actually something else I noticed that seems odd is that when I normally open a page in Selenium, it opens the page in the bottom frame of the session. However, when it tries to open the login page, the selenium frames disappear, and it opens the login page in the entire window.
 
Ben Blanchard
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just thought I'd post the solution I came across (well, it doesn't really solve anything, but it lets my tests run).

When I start my selenium server, I use the -multiWindow option, and this seems to avoid the issue. i.e.

java -jar selenium-server.jar -multiWindow



Hopefully that helps you too, Sachin!
 
Lasse Koskela
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 Ben Blanchard:
Actually something else I noticed that seems odd is that when I normally open a page in Selenium, it opens the page in the bottom frame of the session. However, when it tries to open the login page, the selenium frames disappear, and it opens the login page in the entire window.


That sounds like the login page has JavaScript in it that enforces the login page to be displayed in the "_top" frame, effectively screwing up Selenium which works on the assumption that the application runs in the bottom frame.
 
Get me the mayor's office! I need to tell her about this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic