Questions tagged [automated-tests]

Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process (wikipedia.org).

As per wikipedia.org:

Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process.

There are two general approaches to test automation:

Code-driven testing. The public (usually) interfaces to classes, modules or libraries are tested with a variety of input arguments to validate that the results that are returned are correct.

Graphical user interface testing. A testing framework generates user interface events such as keystrokes and mouse clicks, and observes the changes that result in the user interface, to validate that the observable behavior of the program is correct.

The principle of automated testing is that there is a program (which could be a job stream) that runs the program being tested, feeding it the proper input, and checking the output against the output that was expected. Once the test suite is written, no human intervention is needed, either to run the program or to look to see if it worked; the test suite does all that, and somehow indicates whether the program's output was as expected.

Test Automation also has dedicated section in Software QA & Testing community.

13134 questions
651
votes
19 answers

Get HTML source of WebElement in Selenium WebDriver using Python

I'm using the Python bindings to run Selenium WebDriver: from selenium import webdriver wd = webdriver.Firefox() I know I can grab a webelement like so: elem = wd.find_element_by_css_selector('#my-id') And I know I can get the full page source…
Chris W.
  • 37,583
  • 36
  • 99
  • 136
490
votes
25 answers

Message "Async callback was not invoked within the 5000 ms timeout specified by jest.setTimeout"

I'm using Puppeteer and Jest to run some front end tests. My tests look as follows: describe("Profile Tab Exists and Clickable: /settings/user", () => { test(`Assert that you can click the profile tab`, async () => { await…
Asool
  • 13,031
  • 7
  • 35
  • 49
474
votes
52 answers

Debugging "Element is not clickable at point" error

I see this only in Chrome. The full error message reads: "org.openqa.selenium.WebDriverException: Element is not clickable at point (411, 675). Other element would receive the click: ..." The element that 'would receive the click' is to the side…
user1591169
  • 4,741
  • 3
  • 14
  • 3
338
votes
30 answers

Typing the Enter/Return key in Selenium

I'm looking for a quick way to type the Enter or Return key in Selenium. Unfortunately, the form I'm trying to test (not my own code, so I can't modify) doesn't have a Submit button. When working with it manually, I just type Enter or Return. How…
croixhaug
  • 3,767
  • 3
  • 19
  • 12
264
votes
4 answers

What would be an alternate to [TearDown] and [SetUp] in MSTest?

When I use MSTest Framework, and copy the code that Selenium IDE generated for me, MSTest doesn't recognize [TearDown] and [SetUp]. What is the alternative to this?
Maya
  • 7,053
  • 11
  • 42
  • 53
264
votes
37 answers

Scroll Element into View with Selenium

Is there any way in either Selenium 1.x or 2.x to scroll the browser window so that a particular element identified by an XPath is in view of the browser? There is a focus method in Selenium, but it does not seem to physically scroll the view in…
Dan at Demand
  • 3,259
  • 3
  • 19
  • 10
259
votes
16 answers

Cypress: run only one test

I want to toggle only running one test, so I don't have to wait for my other tests to see the result of one test. Currently, I comment out my other tests, but this is really annoying. Is there a way to toggle only running one test in Cypress?
kuceb
  • 16,573
  • 7
  • 42
  • 56
259
votes
27 answers

How can I scroll a web page using selenium webdriver in python?

I am currently using selenium webdriver to parse through facebook user friends page and extract all ids from the AJAX script. But I need to scroll down to get all the friends. How can I scroll down in Selenium. I am using python.
user2523364
  • 2,599
  • 3
  • 13
  • 3
214
votes
28 answers

Selenium C# WebDriver: Wait until element is present

I want to make sure that an element is present before the webdriver starts doing stuff. I'm trying to get something like this to work: WebDriverWait wait = new WebDriverWait(driver, new TimeSpan(0, 0, 5)); wait.Until(By.Id("login")); I'm mainly…
AyKarsi
  • 9,435
  • 10
  • 54
  • 92
203
votes
11 answers

In Cypress how to count a selection of items and get the length?

I'm starting to learn Cypress. I have a 4 row table (with a class of datatable). I can verify the number of rows this way: cy.get('.datatable').find('tr').each(function(row, i){ expect(i).to.be.lessThan(4) }) This is fine, but it seems…
Katharine Osborne
  • 6,571
  • 6
  • 32
  • 61
179
votes
5 answers

JUnit confusion: use 'extends TestCase' or '@Test'?

I've found the proper use (or at least the documentation) of JUnit very confusing. This question serves both as a future reference and as a real question. If I've understood correctly, there are two main approaches to create and run a JUnit…
Rabarberski
  • 23,854
  • 21
  • 74
  • 96
160
votes
16 answers

Unit testing Bash scripts

We have a system that has some Bash scripts running besides Java code. Since we are trying to test everything that could possibly break, and those Bash scripts may break, we want to test them. The problem is it is hard to test Bash scripts. Is there…
nimcap
  • 10,062
  • 15
  • 61
  • 69
156
votes
20 answers

Compare equality between two objects in NUnit

I'm trying to assert that one object is "equal" to another object. The objects are just instances of a class with a bunch of public properties. Is there an easy way to have NUnit assert equality based on the properties? This is my current solution…
Michael Haren
  • 105,752
  • 40
  • 168
  • 205
154
votes
8 answers

Running Selenium WebDriver Python bindings in Chrome

I ran into a problem while working with Selenium. For my project, I have to use Chrome. However, I can't connect to that browser after launching it with Selenium. For some reason, Selenium can't find Chrome by itself. This is what happens when I try…
Akendo
  • 2,299
  • 2
  • 18
  • 16
154
votes
11 answers

Random "Element is no longer attached to the DOM" StaleElementReferenceException

I'm hoping it's just me, but Selenium Webdriver seems like a complete nightmare. The Chrome webdriver is currently unusable, and the other drivers are quite unreliable, or so it seems. I am battling many problems, but here is one. Randomly, my…
Ray Nicholus
  • 19,538
  • 14
  • 59
  • 82
1
2 3
99 100