How will you type a text into the input file element in Selenium?
October 12, 2007
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 update a file in Java?
October 12, 2007
I’ve been reading books in Java just to find a code on how to update a file just to append a text in it. A lot of code fragments on Java File available but it just give you how to write a file alone, and or how to read a file alone. This article will help you to create at the same time append a text to an existing file.
Here’s a sample of simple and short Java code to create (if not created) and append a file if existing.
public void createOrAppendFile (File f, String text) throws IOException {
BufferedWriter bw = new BufferedWriter (new FileWriter (File, true));
bw.write (text);
bw.newLine();
bw.flush();
bw.close();
}