-1

I'm trying to assert the current styling of a div. For example, is it set to visible or not. I wasn't able to find a way in jwebunit to get at this information though. Ideas? Alternate approaches?

Constraint: I cannot change the page I am trying to test.

Jeanne Boyarsky
  • 12,156
  • 2
  • 49
  • 59
  • What about via XPath? You can retrieve elements through XPath, and get attributes of an element. – Dave Newton Apr 11 '12 at 01:02
  • Dave: It's not an attribute of the div. It css that was applied by a stylesheet (or JavaScript.) The webpage in a browser knows about it. So far I haven't found any evidence that suggests JWebUnit does hence asking here. – Jeanne Boyarsky Apr 11 '12 at 01:55

1 Answers1

0

There are two TestEngines which you can use with JWebUnit, HTMLUnit and Selenium. why not System.out.println("========="+ getPageSource()); and see if the page source return from both TestEngines gives css within the output. If they do that means you can verify css, if the output does not give css then i guess you will not be able to verify. One thing i know for sure is that it will show you the css file the page uses for style but as to the styling being applied I will say not, but try it

user1307037
  • 419
  • 3
  • 5