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
4
votes
1 answer

Pyramid app "Header names must be latin1 string" AssertionError from WebTest

How can I deal with a "Header names must be latin1 string" AssertionError from WebTest that occurs when Pyramid apps are run in Python 2 with from __future__ import unicode_literals? We're in the process of migrating our Pyramid app from Python 2 to…
Sean Hammond
  • 12,550
  • 5
  • 27
  • 35
4
votes
3 answers

python webtest port configuration?

I am attempting to write some tests using webtest to test out my python GAE application. The problem I am running into is that the application is listening on port 8080 but I cannot configure webtest to hit that port. For example, I want to use…
MattM
  • 807
  • 3
  • 11
  • 20
4
votes
2 answers

how to make custom extraction rule property data driven?

I have created custom extraction rule and the property i need the properties to be data driven i.e. I want to attach a data source (CSV file). how do I go about it ? Followings are the screen shots and code snippets that describes the problem Code…
Mithun Ganatra
  • 453
  • 4
  • 21
4
votes
1 answer

Repeating a [TestCase] 100 times in NUnit

I'm converting a webtest that loops 100 times (fires the request and validates the response 100 times) to NUnit. It seems that the [Repeat] attribute only works for [Test], not [TestCase] or any other decoration/attribute. What is the cleanest way…
b15
  • 2,101
  • 3
  • 28
  • 46
4
votes
1 answer

Functional testing with Python WebTest

I am totally new to functional testing with using Python WebTest, please bear with me I was looking at https://webtest.readthedocs.org/en/latest/webtest.html, so I tried out the code as suggested to make a request: app.get('/path', [params],…
Gino
  • 951
  • 1
  • 12
  • 24
4
votes
2 answers

Abort a webtest if an error occurs

Using VS2010's load test feature with recorded webtests. I have problems with cascading errors in my recorded webtests. That is, if one request fails, several other requests will also fail. This creates a lot of clutter in the logs, since usually…
4
votes
3 answers

Is there any alternative for selenium?

I wrote tests for testing a web-site using Selenium а web driver. When I use Firefox a web driver there are no problems, but I must use IE а web driver and there are problems with it. I read many advices for using IE web driver, when .click()…
Alexander
  • 857
  • 6
  • 10
3
votes
3 answers

How do I get the user in Django test?

I have some external services. My Django app is built on top of my external service APIs. In order to talk to my external service, I have to pass in an auth cookies, which I can get by reading User (that cookie != django cookies). Using test tools…
User007
  • 1,519
  • 6
  • 22
  • 35
3
votes
1 answer

How do you fix a memory leak within Django tests?

Recently I started having some problems with Django (3.1) tests, which I finally tracked down to some kind of memory leak. I normally run my suite (roughly 4000 tests at the moment) with --parallel=4 which results in a high memory watermark of…
pgcd
  • 538
  • 6
  • 13
3
votes
1 answer

WebTestPlugin and Http Request parameters (Visual Studio Test)

I am using Visual Studio 2010 Ultimate to perform web and load tests. I have a set of web tests that call REST web services that require OAuth credentials and I'm looking for information on how I can access the associated Http Headers and Post…
3
votes
1 answer

ExpectedResponseUrl error is Visual Studio 2010 web performance test

I have recorded a Web Performance Test in Visual Studio 2010 for a web application that uses Windows Live ID with Secure Token Service for the authentication of the user. There are two requests in my recording that go to https://login.live.com/ and…
λ Jonas Gorauskas
  • 6,121
  • 6
  • 45
  • 66
3
votes
1 answer

Chrome iphone emulation - Testcafe

I am running the following script to run my tests: testcafe --debug-on-fail \"chrome:emulation:device=iphone 6\" tests/e2e/specs/*.spec.js In the TestCafe docs, they use the following to emulate iPhone: chrome:emulation:device=iphone 6 I do not…
3
votes
2 answers

Anyone using webtest without ant?

I'd like to try using WebTest, preferably from Clojure, but I can only find its functionality exposed as Ant tasks. There seems to be some sort of Groovy interface, which implies that it's possible to use from any JVM language outside of Ant, but I…
amalloy
  • 89,153
  • 8
  • 140
  • 205
3
votes
1 answer

Set user count & no. of iterations dynamically in load test in VS2015

I know how to set the number of iterations and the number of users while doing web test/ load test in Visual Studio. But how can i set these dynamically via code. As a tester I just want to go and change the numbers in the code and just run the…
Reema
  • 969
  • 1
  • 10
  • 17
3
votes
3 answers

How to post a Json object in a VS WebTest?

I'm writing some webtests in Visual Studio 2015 Enterprise to do a load test on my API. Several of my API calls expect a Json object as the body of the request. But the webtest interface doesn't appear to have any way to set the body of the Post…
Shaul Behr
  • 36,951
  • 69
  • 249
  • 387
1 2
3
17 18