I have just completed my first two playwright tests, but I am not sure how to optimize them.
The scenario is the following:

I log in to the system with an administrative user.
I create a new user and save the generated username and password using the following code:

// copy username and password
const username = await page.locator(‘#username0’).innerText();
const password = await page.locator(‘#passwd0’).innerText();
expect(username).not.toBeNull();
expect(username).not.toBeUndefined();
expect(password).not.toBeNull();
expect(password).not.toBeUndefined();

I log out the admin user.
I log in the created user (using the const created above), accept the terms and conditions and answer 220 questions, saving a screenshot of every 20th question.

for (let x = 1; x <= 220; x++) {
if (x % 20 === 0) {
await storeScreenshot(popupPage, testInfo, ‘test Q’ + x);
}
await popupPage.waitForLoadState();
await popupPage.locator(user.selector).click();
if (x % 20 === 0) {
await storeScreenshot(popupPage, testInfo, ‘test Q’ + x + ‘ – selected’);
}
await popupPage.locator(‘#submitknap’).click();
}

I am very happy that this works, and it is even parameterized with a csv for testing different answer patterns.
If any step in this fails, the whole case fails.
Ideally the admin part is not necessary as a part of the test and is reusable, but creating a user IS something I want to have. I could create some static users and wipe them before running each test, but I like the dynamic approach of creating a user prior to logging it in. I also have some environments that are not easily reset.
I am in doubt as to how I can split this test scenario up. Should I have the admin part as a helper function called by the testcase, or as a smaller testcase prior to calling the main testcase?
Edit
For a little perspective this test takes 3 minutes to complete. a complete run of 6 parameters in three browsers takes 16 minutes.

Hyperautomation in P&C insurance is transforming the industry by integrating AI, ML, and RPA to streamline operations and enhance customer service. The blog discusses how by automating processes and decision-making, insurers can significantly reduce errors, improve processing times, and meet evolving customer expectations. This approach not only boosts operational efficiency but also ensures compliance with regulatory standards, making it essential for insurers to stay competitive in today’s challenging market.
The post Why is Hyperautomation for the P&C Insurance Industry Important? first appeared on TestingXperts.

AI has taken over many global industries, including software testing. Today, software testers can leverage this innovative technology to boost their workflow and efficiency. If you are interested in software testing or are looking for a career in this field, then you might be interested in the contemporary uses of AI, especially in connection to…
The post Understanding the Integration of AI in Software Testing appeared first on Software Testing Material.

I’m currently building a testing framework for functional tests. I can run them in parallel using Cucumber but I have run into a problem in creating users for each thread (each test requires a brand new user).

I have a user.properties file with details for each new user created. Duplication doesn’t matter for most fields and my emails are different each time because I use something like this “useremail” + System.currentTimeMillis + “@example.com”.

My problem arises when reusing phone numbers. It needs to be a valid phone number and cannot be duplicated across accounts. I tear down users with the phone number at the beginning of each test. But running over multiple threads causes clashes of numbers.

I have 2 stored numbers in my user.properties which I hope to cycle through using a synchronized method for each thread and lock that number to that thread. But I aim to have more than 2 threads (as many phones that I can attach to be honest).

Every solution I come up with feels hacky and I’m quite new to this. Does anyone know of a good solution to distribute a finite number of user properties across multiple threads so they don’t clash?

Thought of using the actual device or emulator’s number (not sure if appium can extract that), but even if I could, my numbers need to be UK numbers

Thanks for your help.

주류 시장에 불어온 새로운 바람 일부 전통주를 제외하고 오프라인 판매만 가능했던 한국 주류 시장은 2020ë…„ 온라인 판매 규제가 개정되면서 새로운…

I am developing a Selenium Test Automation Framework for the purpose of testing multiple websites.

I have currently set up the Framework in Visual Studio using C# and implementing the Page Object Model.

The Framework itself is a C# project and the Test project is separate but references the Framework.

I am happy with the fundamentals of the Framework but I want to implement some Data Driven aspects in order to increase the durability of the tests. I currently have NUnit running paramaterised test using [TestCase] but the data is hardcoded by me.

The ideal scenario would be to add a DatabaseHelper class to the Framework which would allow me to define queries on the database under test to return values and Nunit would repeat the same test for each row of the SQL query.

Has anyone here implemented a similar method and how would you go about creating it?