Twill alternative for integration testing - python

I am using to twill to do integration testing for an AppEngine (using tipfy micro framework) application but unfortunately twill is not maintained and I cannot test PUT and DELETE requests.
Is there any similar solution?
I am thinking of using PhantomJS, there are some python bindings and it can execute JS (as it is a headless webkit but I have not found much).

There are not many alternatives for headless JS testing, you could try selenium 2 web driver. Good luck :)

Related

Distributing py program involving PhantomJS

I have a Python program that works with Selenium and PhantomJS, and I’d like to distribute it. The functionality is quite simple; it goes onto a website, fills certain forms and returns the outcome, without any visible browser action.
The problem is that I can’t expect an arbitrary user to have PhantomJS installed on their computers. How should I approach the distribution process?
I already checked Setuptools and PythonAnywhere, but I don’t think they work for what I want.
Edit: May be too hopeful, but I'd like to be able to distribute it for Windows, OSX and Ubuntu.
The way I do it is through a web application built on Flask (one of many great python web frameworks) and hosted on PythonAnywhere.
To use PhantomJS and Selenium in PythonAnywhere you have to ask for Docker Consoles. Instructions here: https://www.pythonanywhere.com/forums/topic/1320/

Web Server load testing

I am suppose to test web server's load, performance and stress testing. There will be over 100 client machines that will be connecting to it.
I am using python-selenium webdriver to start a grid. the server is considered as a selenium 'hub' and clients as 'nodes'. This part is working fine till now.
Now the hard part, I need to monitor the server's performance, load and stress from another third party system while the scripts are running.
Is there any possibility if this can work ? I tried using many open sources like funkload, locust, web server stress tool 8. But none of them can monitor the load tests that is swarming dynamically on to the load.
While I was browsing in this site; I came across this project on https://github.com/djangofan/WebDriverTestingTemplate. Will this be helpful to my project?
Selenium is a functional tool so it's not a good idea to use it for performance test.
To achieve same you can go with JMETER as it a good open source tool available
still if you want to use selenium then there is some script present to integrate JMeter with selenium. I never tried it but you can try it.
Refer below link for same:-
https://blazemeter.com/blog/jmeter-webdriver-sampler
http://seleniummaster.com/sitecontent/index.php/performance-test-menu/selenium-load-test-menu/174-use-selenium-webdriver-with-jmeter
Hope it will help :)
It is possible to do with Selenium, but it will take much more resources (especially your time).
I would also recommend to try out the
LoadComplete from SmartBear
It is a very simple and intuitive tool, which lets you run and schedule your tests + send a report with execution results.
You can use Apache JMeter to conduct the load from 3rd-party web server.
With PerfMon Metrics Collector plugin you will be able to get server-side health metrics along with the load test results.
See Getting Started: Scripting with JMeter guide and Learn JMeter in 60 minutes for quick ramp-up on Apache JMeter.

Is there any inbuilt browser for web automation using python?

I have tried splinter for browser automation. Used firefox webdriver in splinter. But the problem is high CPU usage when the firefox loads and sometimes its hangs the gui. Please suggest me an option. I'm in a Linux box(Ubuntu) and building an app using pygtk.
Selinum with phantomjs should be a good replacement of splinter.

phantomjs doesn't support flash player in windows machine

I am developing a python script to take screenshots from many websites. for this I am using below tools,
phantomjs with selenium
python
windows PC
I have used pyside(instead of phantomjs) for that job but I faced many issues on pyside..
now I have found phantomjs tool from Google.com, I have used phantomjs with selenium for python in windows machine it is working flawless. but it has only one issue phantomjs doesn't support flash player, so am not able to process youtube and some flash websites.. please give me the some quick fix for this
PhantomJS does not and probably will not support Flash and other plugins (see here).
But you can use SlimerJS in your Selenium tests, which is a headless browser based on the Gecko engine. It does support the WebDriver protocol, so use it.
There is also a fork of PhantomJS with Flash support, but it didn't merge changes in PhantomJS back into it, so it is standing still at version 1.9.0.
Phantomjs now don't rely on xwindow enviroment since 1.5, also it has remove plugin support at that time. So there is no officially support for running flash player in current phantomjs version.
Howerver, there are so many project fork from the old phantomjs that has flash player enabled and keep update. You can try r3b phantomjs. Recently I had build a perfect service upon this project under ubuntu os.

Website automation using Python

I m trying to automate a Web Application validation performed by my team.I have choosen Python as the language to do this, although my exp. with Python is very limited.I have done similar things in the past using Perl. Now the problem is that after posting the url of the website it directs to a logon page which is made in Javascript. From whatever little Python I know, I believe scrapping/parsing website made in Javascript is not possible. I faced the same issue while doing this with Perl as well and wasn't able to proceed.
Any pointers or help in resolving the above issue would be highly appreciated.
Thanks
Spynner may help http://code.google.com/p/spynner/
Maybe you can take a look a Selenium. It's a firefox plugin that enables automation, but it also has a webdriver system where you can write automation scripts in various languages (including python), and a server execute the code in various browsers. I never tried the webdriver part myself, but that should do what you want.

Categories

Resources