How will you type a text into the input file element in Selenium?

The common problem in Selenium is typing a text into the input element (<input type=”file” />). And this is the common problem I read from most of the forums and I also find it difficult to solve.

I am just a newbie in Selenium and I do not know how to handle problems using this web testing tool. I’ve been Googling in a week just to find an answer. I was lucky because I found one and it really works.

Here are the possible solutions to your problem:

  • Use *chrome environment type rather than *firefox or *iexplore.
  • Set your singed.applets.codebase_principal_support to true in your Mozilla configuration.

I’m crossing my finger on that. Try it and tell me if that works in your machine.

How to setup a headless application in Linux?

I am a newbie to Linux environment and do not know every commands available inside the shell.

This entry will explain and demonstrate to all newbies out there and to those who have not know to setup a headless application in Linux and for those who want to setup headless application in Linux.

Install the following in your Linux distro if you have not install them yet.
1. Xvfb
2. startx
3. import from ImageMagick Tools

Let’s try to run Firefox without a visible display.
1. Start Xvfb.
startx -- `which Xvfb` :1 -screen 0 1024x768x24
2. start Xvfb running on :1 with a screen size of 1024×768 and 24bits/pixel color depth.
DISPLAY=:1 firefox
3. Take a screenshot.
DISPLAY=:1 import -window root firefox.png
Thank you to Jordan Sissel for his blog regarding this problem.