[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

cross browser compatibility test

Posted on 2011-04-19
5
Medium Priority
?
785 Views
Last Modified: 2012-05-11
Hi All ,

I need to write a java program, that takes url as input and check it is compatible with different browser or not?

I dnt have any idea ,how I will achieve this ?? please Help me asap.
0
Comment
Question by:naishi
  • 2
4 Comments
 
LVL 2

Expert Comment

by:Gnarf
ID: 35431062
The question of compatibility is the question of "consistent display", I suppose?

So, you must render the page and verify the output is the same on every browser.

Applets can gain access to the DOM (the document object model, containing all the elements). This should supply you with the informations on your HTML elements you desire. In general, all you need to do is to verify the positions are correct.
To get access, you might choose to insert your examining applet into the code by reading the HTML and putting the applet code at the end (before the </body> tag). The applet will not display anything but may opens a connection to the master Applet (or writes a file - you can supply parameters in the HTML code calling the applet).

What "correct" exactly means, depends on your problem; for example, if the page has a slightly bigger top margin on one browser doesn't matter. But if your language flags are each displayed on a separate line instead of being put top-right in a single line IS a serious problem.

If all browsers have been opened and the informations were transmitted you need to verify the results. This should be the most work by far, as you should not use exact values but somewhat unsharp values.
Remember that there are netbooks out there - web pages often rendered useless by divs put in front of it without the chance to close them as the close button is hidden der to the screen resolution! Which leads to another interesting parameter: Scrren size, and resolution, maximized display vs. normal view, JScript (enabled or not), Flash elements, input driven (php script, java-created (jetty server, tomcat,...) )  ...

Its a big project, but if you succeed it's shurely worth the work. You may even sell the result, as web developers always have the problem of cross browser compability. Currently, I have to open the page on all browsers (not only the different flavors like Firefox, Safari, Chrome but also the different versions of those browsers!) and verify the display manually. After that, I need to tweak the page and redo the process (because my changes may have side effects on other browsers/versions).

Automating thistime-consuming  process would be a real potential!

0
 

Author Comment

by:naishi
ID: 35431886
Hi Gnarf,

Thanks for ur reply. But My thing is different . I need to create a small application ,in which User wll enter their website url and I have to say them that their website is perect in for ex. IE 7 ,IE 8, but there are some Missing content or functionality on IE 5 and IE6, So your website is compatible with IE8 and IE7 but not with IE6 and IE5.  I need to do it against many browsers not only IE. And I have no idea how to achieve it.

So, I ll be very greatful if you or any1 can help me out. I am using JAva for my project.
0
 
LVL 2

Accepted Solution

by:
Gnarf earned 2000 total points
ID: 35450534
Reading your post again tidy comes to my mind. That tool checks the given HTML code to be compilant to the W3C specification. This is a fomal check of course and it is (and has to be) browser independent. Not knowing your requirements, maybe a link to the tidy page may do?

If this is not the solution, go back to the roots and forget about programming for a while. Define exactly what you want to understand under the term "compatible". There are several answers:
1. Exact pixel layout
      - Where do you get the reference from? You may use the firefox browser as reference and compare the layout of other browsers against it. Or you    implement a css layout engine of you own (it`s a project of its own!).
      - Or you expet your customers to hand over a file (I'd suggest XML) where all the expected positions are listed.
        This XML could mirror the HTML DOM supplying the (x,y) coordinates, heights and widhts, colors, brders, .... in
        XML attributes.
      
2. A somewhat 'congruent display'
      - Again: Where do yo get the refrence from? (same problem as above)
      - What kind of fuzzyness you're after? How do you implement it? should the user select the fuzzy degree/areas to apply fuzzyness?
      
Some problems you may come across:
1. How do you handle scripts?
      - Scripts, applets and the like may alter a pages display.
        Imagine a page from a shop, eg the basket: The contents displayed differ with the goods the user is about to order. While you also may need to log on (this can be solved by first log on and call the check lateron from a different tab), depending on your selections (card payments, known customer or not, ..) a php script may choose to omit certain HTML statements.
        
        From my point of view it is impossible to handle that kind of dynamic content.
        
2. How to handle frames?
      - If you come across frames you need to check the content pages to be displayed inside the frames.
        And those may contain another frame set and so on. In other words, you not only have to parse the contents of the url given for the
        presence of frames but also all of its sub pages included in those frames.
        
As you see, your project is not a trivial one.

The next big issue comes from the technical approach of using applets. Those run locally on the users computer and are normally very restricted in terms of file access and other resources. Also, to check the browsers you need to open the browser. I bet, not every user has all available browsers in all versions installed (not to mention the problem of finding the correct install path).

This leads to the necessarity of having a process on your server along with the applet that will do the work in a defined environment. The applet will communicate with the URL object with the server app and is somewhat of a GUI to that piece of code.

Take into account thet the check is a time consuming task so you need to give feedback to the user (progress bar). To do this in conjunction with socket communication you'll need threads. This poses special needs to the programming (deadlock prevention, synchronisation, data exchange,...).

I'm interested how you'll proceed. If I can I'm willing to help.

HTH
Gnarf
0
 
LVL 31

Expert Comment

by:James Murrell
ID: 36434102
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question