A JBoss Project
Red Hat

Frequently Asked Questions

General BrowserSim

  1. What is BrowserSim?

    BrowserSim is a browser simulator which primarily is intended for having a quick, easy and multi-platform way of testing if your webapp will render and behave correctly on a mobile device.

  2. Can I use BrowserSim as a replacement for testing on a real phone or emulator?

    BrowserSim makes it easy to test basic layout questions / issues on any platform without having to install a platform specific emulator or manually using a phone. That said it is not 100% reliable since there are so many different brands / versions of phones there will be differences in behavior, thus no, BrowserSim does not replace real or emulated phone testing. For full verfication and testing you should test on a real phone.

  3. How does BrowserSim work?

    It wraps a WebKit browser (SWT WebKit and JavaFX WebView) and makes it respond and work like a mobile browser by spoofing content and media request headers.

  4. So, BrowserSim has two web engines, doesn’t it?

    Yes. In the original there was only one web engine - SWT WebKit. Unfortunately it has several drawbacks. For example, using SWT WebKit on Windows requires users to install Apple Safari (provides SWT WebKit engine), which is pretty obsolete for now - May 9, 2012 was the last update. Additional SWT WebKit doesn’t support Debugger API. Due to these limitations it was decided to add JavaFX web engine support. Web engine can be switched via BrowserSim’s preferences in the Settings tab:

    BrowserSim’s web engine seletion
  5. What do I need to run BrowserSim?

    If you want to use JavaFX web engine all you need is to run BrowserSim against Oracle JDK version 7 or higher (version 8 is recommended). JDK can be specified via WindowPreferencesJBoss ToolsBrowserSim/CordovaSim:

    BrowserSim/CordovaSim preferences

    For SWT WebKit web engine the requirements for different platforms are as listed below:

    Windows
    • Apple Safari must be installed (it provides WebKit engine for BrowserSim).

    Linux
    • WebKitGTK 1.2.0 or newer must be installed and available in the library load path. To do it use your package manager:
      Fedora, Red Hat Enterprise Linux (RHEL) - yum install libwebkitgtk-1.0.so.0
      Ubuntu - apt-get install libwebkitgtk-1.0-0

    Mac OS X
    • Available out-of-the-box.

  6. How to add BrowserSim to the toolbar?

    Go to WindowCustomize Perspective and select BrowserSim under Command Groups Availability. Then it becomes available in the global toolbar via the "phone" icon:

    BrowserSim’s toolbar icon

Main Features

  1. Can I debug with BrowserSim?

    Yes, you can but only with JavaFX web engine which supports Debugger API (Chrome browser is a requirement). Right-click on the BrowserSimDebugDev Tools. The following pop-up will be shown:

    BrowserSim Dev Tools

    Open URL in Chrome and start to debugging.

    URL for debugging must be opened only in one browser. If you open in a second browser the browser will just stay empty.

    SWT WebKit can’t handle Debugger API. However there is a FireBug Lite menu item instead of Dev Tools for that web engine. Using FireBug Lite you can preview HTML, CSS, DOM and scripts.

  2. How to enable LiveReload for BrowserSim?

    Both SWT WebKit and JavaFX web engines support LiveReload. First of all you should add the LiveReload Server and start it:

    • Open Servers view (WindowShow ViewServers).

    • Add the LiveReload server, which is available in the Basic category:

      LiveReload server

      After that Right-click on the BrowserSimEnable LiveReload. That’s it - LiveReload is enabled!

    If you want to use LiveReload with JavaFX web engine you must run BrowserSim against Oracle JDK 8. JavaFX browser which is shipped with JDK 7 has no WebSocket support, which is vital for LiveReload functionality. Fortunately it is fixed in JDK 8.

Known issues

  • Dev Tools Debugger doesn’t work properly with the Oracle JDK 8u20 - JDK-8090205, JBIDE-18526

  • JavaFx which is shipped with Oracle JDK 7 has no localStorage support. Fortunately, it is fixed in JDK 8 - JDK-8101833

  • JavaFx which is shipped with Oracle JDK 7 has no WebSocket support, which is vital for LiveReload functionality. So, LiveReload doesn’t work with Oracle JDK 7 for JavaFx web engine. Fortunately, it is fixed in JDK 8 - JDK-8097808

  • JavaFx HTML 5 Date and time inputs do not function properly - JDK-8087937, JBIDE-17054

Platform Specific Questions

  1. Is it possible to run BrowerSim against GTK 3 on Linux?

    By default BrowserSim is launched against GTK 2. However, there is a Linux specific option to enable GTK 3 for the process launched by BrowserSim / Cordovasim but JavaFX web engine will be unavailabe. Basically JavaFX uses GTK 2 libraries and is unlikely to switch in the near future. Here is the related jira issue.

    GTK selection on Linux
    In order to run BrowserSim against GTK 3 libwebkitgtk-3.0 must be installed.
    Fedora, RHEL - yum install libwebkitgtk-3.0.so.0
  2. I’m not able to find libwebkitgtk-1.0.so.0 on RHEL 7. What should I do?

    Since there is no webkitgtk package for RHEL 7, you cannot launch BrowserSim with SWT.Webkit engine under GTK2. You can launch BrowserSim under GTK2 only with JavaFX(requires Oracle JDK).

  3. I’m not able to find libwebkitgtk-3.0.so.0 on RHEL 6. What should I do?

    Since there is no webkitgtk3 package for RHEL 6, you cannot launch BrowserSim with SWT.Webkit engine under GTK3. You can launch BrowserSim only under GTK2 in RHEL 6.

  4. I have Oracle JDK installed on Linux, but I cannot set JavaFX as web engine. What should I do?

    If you install Oracle JDK via package manager (using i.e. yum install java-1.7.0-oracle-1.7.0) you might need to also install JavaFX package. The instructions might vary for your distribution, but on RHEL it can be installed using command like yum install java-1.7.0-oracle-javafx.

back to top