cross browser compatibility test

Posted on 2011-04-19
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.
Question by:naishi
    LVL 2

    Expert Comment

    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!


    Author Comment

    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.
    LVL 2

    Accepted Solution

    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.

    LVL 31

    Expert Comment

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

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

    755 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now