Questions tagged [webtest]

WebTest helps you test your WSGI-based web applications, which includes most actively developed Python web frameworks.

WebTest helps you test your WSGI-based web applications. This can be any application that has a WSGI interface, including an application written in a framework that supports WSGI (which includes most actively developed Python web frameworks – almost anything that even nominally supports WSGI should be testable).

With this you can test your web applications without starting an HTTP server, and without poking into the web framework shortcutting pieces of your application that need to be tested. The tests WebTest runs are entirely equivalent to how a WSGI HTTP server would call an application. By testing the full stack of your application, the WebTest testing model is sometimes called a functional test, integration test, or acceptance test (though the latter two are not particularly good descriptions). This is in contrast to a unit test which tests a particular piece of functionality in your application. While complex programming tasks are often is suited to unit tests, template logic and simple web programming is often best done with functional tests; and regardless of the presence of unit tests, no testing strategy is complete without high-level tests to ensure the entire programming system works together.

WebTest helps you create tests by providing a convenient interface to run WSGI applications and verify the output.

To find out more, visit http://webtest.pythonpaste.org/en/latest/

270 questions
1
vote
2 answers

.NET WebTest - Get Response Bytes for ValidationRule

I need to create a ValidationRule to test response bytes including responses for dependent requests. It is easy task to get response bytes for main requests, but I can not access responses for dependent requests. I have no idea how to do…
Denis
  • 89
  • 1
  • 8
1
vote
3 answers

Waiting for ajax request to finish before getting the resposne

I'm extremely new to mvc and webtest so please bear wtih me here. I have a customer view. The customer view calls a javascript function on document.ready. This javascript call performs an ajax post to an action in the customer controller which…
earthling
  • 5,084
  • 9
  • 46
  • 90
1
vote
2 answers

Local unit testing for Google App Engine + Python WebApp2

I have a really simple web app. All the important stuff happens in index.py: from google.appengine.api import users import webapp2 import os import jinja2 JINJA_ENVIRONMENT = jinja2.Environment( …
mcl
  • 223
  • 2
  • 7
1
vote
1 answer

WebTest: Testing with decorators + datastore calls

I have a Google App Engine application and my request hadnler has a decorator that does authentication. With WebTest I found out yesterday how you can set a logged in user and administrator. Now today my authentication decorator got a little more…
Pickels
  • 33,902
  • 26
  • 118
  • 178
1
vote
1 answer

Visual studio web test for api request failure 'Invalid HTTP header characters'

I'm trying to hit a Oauth2 secure Web API from a visual studio web test. I'm using a custom WebTestPlugin and custom WebTestRequestPlugin. The web test plugin simply gets the token from azure active directory and shoves into the request. That seems…
Mateo
  • 187
  • 1
  • 4
  • 15
1
vote
1 answer

How to check template context using Pyramid + webtest

I'm starting writing tests for my Pyramid views (using webtest), and coming from a Django background I'm having an hard time trying to understand how to test that certain variables have been passed to the template. For example let's consider this…
daveoncode
  • 18,900
  • 15
  • 104
  • 159
1
vote
1 answer

groovy webtest chokes on context root in url invoke

I am trying to wrap my head around canoo webtest I setup a simple groovy webtest. I have even made and run the xml equivalent and I get the same error when it tries to encode the url. I get an error when I use a context root. I don't get an…
branchgabriel
  • 4,241
  • 4
  • 34
  • 48
1
vote
1 answer

Pyramid fails to start when webtest and sqlalchemy are used together

I am trying to setup a pyramid app to use both webtest and sqlalchemy. If I comment out the SQLAlchemy code, the webtests run without a problem. [Test log ] https://travis-ci.org/caffeinated-expert/frisbee/builds/91622436 Error Traceback (most…
casibbald
  • 2,805
  • 2
  • 16
  • 14
1
vote
1 answer

VS Webtest: How to use extracted value from request in Webtest loop count?

I have two extracted values (count and count1) -> these should be integers. I need to subtract (count1 - count = difference) and use the difference in a loop of webtest (delete generated groups). How can I pass this result to Webtest loop…
1
vote
1 answer

bind data source to Context Parameters in Web Performance Test using Visual Studio?

I have a web performance test which tests an API. My API has Context parameters for which I would like to fetch values form database. I can find how to fetch/bind values to Form Post parameters, but I need for Context Parameters. Please help me in…
1
vote
2 answers

Display time for webtest plugin in playback UI window

I have written a Visual Studio (2008) Webtest plugin, and need to display the time it takes to run in the playback ui window. I've tried: e.WebTest.BeginTransaction("B2BValidate"); // then call my…
Matt Frear
  • 52,283
  • 12
  • 78
  • 86
1
vote
2 answers

Initiate Button click action using Watir Ruby library

Watir::Browser.default = "firefox" ie = Watir::Browser.start("http://cars.com") ie.select_list(:id, 'make_1').set('Chevrolet') ie.select_list(:id, 'model_1').set('Cobalt') ie.select_list(:id, 'pricehighnew').set('No Max') …
Bambi
  • 11
  • 2
1
vote
2 answers

Unit testing Bottle app with WebTest

I've been attempting to familiarize myself with unit testing but have been having a lot of trouble with it. I have a bottle app that I tried using Unittest, which didn't seem appropriate, so now I'm trying WebTest. The trouble is that I can't get it…
Cameron Sima
  • 5,086
  • 6
  • 28
  • 47
1
vote
1 answer

How to run all web tests by command line

I have dedicated DLL project for webtests. I know how to run specified webtest C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE>mstest /testcont ainer:"MyPath\PostAccessToken.webtest" /resultsfile:MyResultPath\MyResults.trx But how…
Jacek
  • 11,661
  • 23
  • 69
  • 123
1
vote
1 answer

Passing parameter to SOAP Web Service Requests Using Visual Studio Team System 2008

How can I pass in the current datetime parameter to a SOAP request? I know you can pass in parameters by adding a datasource to the web test project and reference it like this {{DataSource.TableName.FieldName}}. But I want to pass in current…
Nicholas
  • 35
  • 2
  • 8