Adam Monsen

July 26, 2011

Debugging web tests on remote servers

Filed under: Default — Tags: , , , — adam @ 8:01 am PDT

I run “web tests” on a remote server. I use Selenium to act like a person interacting with a website, viewing and entering data. Selenium is pretty awesome, it can drive a real web browser like Firefox.

Even better is to have these web tests run automatically every time I commit code. I use Jenkins for this. Jenkins even fires up a headless desktop so Selenium can run Firefox.

When a web test breaks (especially in some way I can’t reproduce on my local desktop), sometimes it helps to actually see what Jenkins sees as it runs the test. Here’s a quick guide for doing so on an Ubuntu GNU/Linux server.

  1. Connect to the remote server using SSH. Install VNC server:
    sudo apt-get install vnc4-server
  2. On the remote server, become the user tests run as. For example:
    sudo su - ci
  3. Set a password for the VNC server using the vncpasswd command.
  4. Start headless X server by running vncserver. Note the given display. If example.com:1 is included in the output of vncserver, the display is :1.
  5. Figure out which port the VNC server is using. I usually do something like

    sudo netstat -nape | grep '^tcp.*LISTEN.*vnc.*'

    Here’s some example output:

    tcp        0      0 0.0.0.0:6001            0.0.0.0:*               LISTEN      107        3099855     13233/Xvnc4     
    tcp6       0      0 :::5901                 :::*                    LISTEN      107        3099858     13233/Xvnc4

    By trial and error, I figured out that 5901 was the port I should use.

  6. Port-forward VNC to your local machine.

    1. Disconnect from the server.
    2. Reconnect, including -L10000:localhost:5901 on your SSH command line.
    3. Leave this connection open.
  7. On your local machine, connect a VNC client to localhost:10000. An X terminal should be displayed.

  8. In the X terminal, run your web tests.

  9. When finished debugging, kill the X server using the display noted earlier.
    vncserver -kill :1

January 9, 2009

Passwordless SSH and other Tutorials

Filed under: Default — Tags: , , , — adam @ 3:00 pm PDT

New to GNU/Linux? Trying to get started with the same tools used by the pros? Check out linuxconfig.org.

I helped them with their Passwordless SSH tutorial, and I like the screencasts in the Vim tutorial.

September 24, 2008

I’m a Talker

Filed under: Default — Tags: , , , , , — adam @ 9:56 am PDT

I’ll be giving a couple of lectures/seminars this week in the Twin Cities. The first is tonight at the U of M (topic: Selenium), the second will be Saturday morning (topic: Vim). See here for announcements about future talks and materials from talks past.

September 21, 2008

The Pigeon is Back!

Filed under: Default — Tags: , , , , — adam @ 9:01 pm PDT

Keeping me up late… keeping me from working on my upcoming Vim and Selenium talks. This time with fast-booting desktops!

Found on this Slashdot thread:

  1. ASUS motherboards now ship with an embedded mini Linux distribution to give you Web browsing and Skype in seconds
  2. A pretty cool-looking bootable os and desktop written entirely in assembly

August 13, 2008

Plug and Play Linux Webcam

Filed under: Default — Tags: , , , — adam @ 10:31 am PDT

Based on this review I bought a Logitech QuickCam Pro 9000. I ignored all the red tape and “Run The Installer First!” warnings on the packaging, and plugged it in to my Ubuntu 8.04 laptop. And it worked immediately. Yay! Skype, Cheese, both work. Video sharing via Flash (like for Dimdim) doesn’t work, so no extra credit, yet. :)

My face with edge effects

My face with edge effects

May 26, 2008

Ubuntu and Encryption

Filed under: Default — Tags: , , , , — adam @ 4:10 pm PDT

Encryption is a nice security feature that makes it significantly harder for someone to mine your data if, for instance, your latptop is stolen.

If you install Ubuntu with the alternate installer disk, encryption takes only a few keystrokes. Here are two tutorials with screenshots.

If you only need to encrypt a single file, just right-click on the file in the File Browser and click “Encrypt”.

Powered by WordPress