12

Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?

8 Answers 8

6

You could try selenium.

Sign up to request clarification or add additional context in comments.

Comments

4

The PyXPCOM extension is one possibility.

But looking at what firewatir provides, I have to 2nd the suggestion for twill. It's based on mechanize, which might also be useful in this context.

3 Comments

mechanize ended up giving me the most functionality...thx
just came across this and have to say that PyXPCOM looks really old and dusty, so to speak, its at least as old as 2001 and its hard to find much about how to use it, mechanize is ok but has some limitations like not able to handle javascript and also no way to automatically download normal things that are downloaded by a browser on page load (such as css, images, etc)
Link to PyXPCOM add-on is broken.
2

I use Selenium RC. All my tests are written in Python and are run with test suite.

One minor thing is that You either have to start selenium manually and point Your tests to it or start selenium from test suite which requires little bit of coding. But it's doable.

Generally I'm very pleased with this solution.

2 Comments

Do I still need Java for Selenium Server running?
Yes, as Selenium is written in Java.
1

See if twill can help you. It can be used as a command line tool or as a python library.

Comments

1

I would suggest you to use Selenium instead of Mechanize/Twill because Mechanize would fail while handling Javascript.

Comments

0

The languages of choice of Firefox is Javascript. Unless you have a specific requirement that requires Python, I would advice you to use that.

1 Comment

I don't think javascript would be appropriate for this it can't really compare to python for doing automation, etc but I suppose if you absolutely had to you could have javascript interact with your python script
0

Install Mozlab in Firefox and enable the telnet server, then open a socket.

Comments

0

Many command line tools don't have a javascript interpreter so do not support web 2.0 functionality. juicedpyshell is based on PyXPCOMext's PyShell example. It gives you a python shell window "inside" the browser, and simplifies access to both the DOM of what you are browsing to and also the shell window itself (so you can add GUI elements as part of your automation script). But its a new project so probably not as full featured as some of the above.

1 Comment

looked nice but sadly development seems to have stopped as the last version is older than your post.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.