Been scouring the net for something like firewatir but for python. I'm trying to automate firefox on linux. Any suggestions?
问题:
回答1:
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.
回答2:
You could try selenium.
回答3:
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.
回答4:
See if twill can help you. It can be used as a command line tool or as a python library.
回答5:
I would suggest you to use Selenium instead of Mechanize/Twill because Mechanize would fail while handling Javascript.
回答6:
The languages of choice of Firefox is Javascript. Unless you have a specific requirement that requires Python, I would advice you to use that.
回答7:
Install Mozlab in Firefox and enable the telnet server, then open a socket.
回答8:
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.