Questions tagged [testing]

Software evaluation encompasses various activities targeting the assessment of a program or system's attribute or capability, ensuring its fulfillment of desired outcomes.

Troubleshooting issue with setting browser version using Selenium Add Additional Capability in .NET Framework not resolving

I am currently working on testing my program across various browser versions. To begin, I opted to use ChromeDriver by implementing the following code: using OpenQA.Selenium.Chrome; ChromeOptions Options = new ChromeOptions(); Options.PlatformName = " ...

gRPC in Python: Unable to create an instance of abstract class ServicerContext

Trying out this method: def my_method(self, request, context): context.set_details('Already exists') context.set_code(grpc.StatusCode.ALREADY_EXISTS) To test it, I need to provide a request and a context (which is a grpc.ServicerContext ...

Ways to exchange information (such as temporary paths) among Django test suites

class MyTestCaseA(TestCase): def setUp(self): # Setting up some initial configurations... def test_case(self): # Executing some test scenarios class MyTestCaseB(TestCase): def setUp(self): # Initializing necessary setu ...

Testing controllers using RSpec with JSON parameters successfully passing

I'm currently working on creating a POST json request in an RSpec Controller test, where I need to pass params. Take a look at my code snippet below: it 'returns access_token' do post :login, email: 'bla', password: 'bla1', format: :json When I exami ...

Utilize Firebase for Playwright to efficiently implement 'State Reuse' and 'Authentication Reuse'

In my testing environment, I want to eliminate the need for repeated login actions in each test run. My approach involves implementing 'Re-use state' and 'Re-use Authentication', but I've encountered a challenge with Firebase using indexedDB instead of Coo ...

Creating Selenium reports with Jenkins (formerly known as Hudson) from JUnit XML files

When it comes to automating tests for our web project, we rely on a combination of Hudson, PHPUnit, and Selenium. Our test results are saved in the JUnit XML format. However, when attempting to include report generation using the Hudson feature Publish JU ...

Is it possible to link together supertest requests that are reliant on one another?

Currently, the output shows: Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises Warning: .end() was called twice. This is not supported in superagent GET /api/things 200 3.009 ms ...

What is the best way to check if a function has been successfully executed?

When working with PDF documents, I often use an instance of pdfkit document known as doc: import PDFDocument from 'pdfkit' const doc = new PDFDocument() This doc instance is then passed into a function called outputTitle: export const outputTi ...

What sets apart toBeInTheDocument from getBy* in @testing-library/react?

Can you distinguish between these two methods in react-testing-library? expect(screen.queryByText('<something>')).toBeInTheDocument(); And screen.getByText('<something>'); (The specific getBy* and queryBy* operation are no ...

Locating and identifying visible elements on a web application with Selenium

I am struggling to locate visible elements on a web application page using Selenium. Specifically, I need to identify a clickable row and then click on it. The challenge lies in the fact that these elements are dynamically generated and do not appear in ...

Having trouble resolving issues with Selenium's Java WebDriver and ChromeDriver?

Hello! I'm encountering an error even after adding all the necessary jar files to the classpath. I have an interview coming up on Monday, so I really need to resolve this issue as soon as possible. My Java version is 21 and Chrome version is 122. Can anyo ...

Guide to Testing a Vue.js Application by Simulating API Requests in the Browser

My project involves an app with Vue.js on the frontend and Spring-boot on the backend. I am looking to perform "unit testing" or integration testing of my views by utilizing a browser and Selenium, while also mocking API calls (ajax requests). What tools ...

Implement Stripe API mocking using Jest in Node.js with Typescript

I'm having trouble simulating the Stripe API for testing purposes. Although I don't have much experience with mocking functions using jest, I've already extensively researched how to mock the Stripe API without success. My file structure is as follows: sr ...

Unable to retrieve docx files with selenium in headless chrome

Currently, I am in the process of automating an end-to-end (E2E) task that involves downloading files from a drop-down menu. The functionality works flawlessly using chromedriver without the headless mode activated. However, when I enable Chrome options fo ...

Testing a component in Angular 2 that utilizes the router-outlet functionality

I recently set up an angular 2 project using angular-cli. As part of the setup, I created a separate AppRoutingModule that exports RouterModule and added it to the imports array in AppModule. Additionally, I have the appComponent which was generated by an ...

How can I monitor and handle JavaScript errors without causing TestCafe tests to fail?

As I begin writing TestCafe tests, a problem arose on our website - a JS error in the console causing test failures. While it was satisfying to catch this issue, it also highlighted the fact that even minor JS errors could lead to test failures and hinder ...

What are some solutions for troubleshooting a laptop freeze when running JavaScript yarn tests?

Running the yarn test command results in all 20 CPU cores being fully occupied by Node.js, causing my laptop to freeze up. This issue is particularly troubling as many NodeJS/Electron apps such as Skype, MS Teams, and Slack are killed by the operating syst ...

Does conducting a unit test involve testing a backend api endpoint?

Let's say you have a Node server running Express and you decide to write a Jasmine test to verify that POST /someroute returns the expected JSON response. Is this still classified as unit testing? While it may not align perfectly with the traditional ...

Issues with importing Selenium in Python, using Python-Selenium with Eclipse

Upon Executing the Command Below: from selenium import webdriver The Following error Occurs: Traceback (most recent call last): File "C:Users empjatopworkspaceTestPythonSample.py", line 1, in <module> from selenium import webdriver Fi ...

What is the best way to conduct tests on React components' methods and ensure they are integrated into my Istanbul coverage report

Is there a way to test the methods of react components and include them in my Istanbul test coverage? Edit: I'm using enzyme. Just wanted to mention that. Take, for instance, this component: class SearchFormContainer extends Component { static handle ...

issues arise with tests following the transition from Angular 9 to Angular 10

Recently, I encountered an issue with my jest-tests after updating Angular from version 9 to 10. These tests were working perfectly fine before the update. Can someone guide me on how to resolve this issue? Below is one of the tests that is causing troubl ...

Exploring the Potential of Express and Mongoose through Mocha Testing

I'm currently experimenting with testing my REST API endpoint handlers using Mocha and Chai. The application was developed using Express and Mongoose. Most of my handlers follow this structure: var handler = function (req, res, next) { // Process the ...

Implementing NPM commands in Jenkins using shell scripting

Whenever I attempt to run the "npm" command, I encounter a syntax error. Users/Shared/Jenkins/Home/workspace/projectName/npm test ^^^^ SyntaxError: Unexpected identifier This is the Jenkins Build shel ...

Can you explain the BDD feature file structure for transferring to TestRail?

Having trouble importing BDD feature files from my Automation Framework into TestRail. Even after using the 'Import .feature files into TestRail' feature, the file imports without any testcases and I'm unable to manually add them. Trying to import .featur ...

Angular 4 after ejection, coupled with automated end-to-end testing using Protractor/Selenium setup

I am attempting to conduct end-to-end tests using Protractor/Selenium on an Angular 4 project that has been ejected. Here is my package.json: ... "scripts": { "pree2e": "webdriver-manager update --standalone false --gecko false --quiet node", "e2 ...

When attempting to execute a promise within a test, encountering a 400 error in a NodeJS environment

I recently started using Contentful, a new JavaScript library for creating static websites. My goal is to incorporate it into my Node.js project. To achieve this, I developed an app file called getContent.js: 'use strict'; var contentful = req ...

Testing Content Rendered in a Modal or Popover using React, Jest, and Material-UI

Some material-ui components, such as Dialog and Menu, do not render their results in the same location as where they are placed by their parent component. Due to this behavior, testing for the presence of content within these components becomes challengin ...

What is the best way to check for a "click" event on the icon button within the material-ui AppBar component?

I'm currently experimenting with a React component: import React from 'react' import AppBar from 'material-ui/lib/app-bar' class NavBar extends React.Component { render () { return ( <div> <AppBar title='My Custom N ...

Issue with Selenium Testing: Struggling to choose a date from the calendar options

For some reason, I am facing an issue where I can't seem to select the date value from the calendar list. However, all the other tests are working perfectly fine. import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.sele ...

What is the process to extract a data list from a frame, access and click on a link within the frame, and then proceed to click on another link within

I have uploaded a screenshot for your reference. I successfully logged into the website, but I am unable to navigate to a specific link and click on it. Here are the steps I need to perform: Retrieve the list of stocks from the frame and save it Select a ...

Difficulty in locating tests with coverage detection

The coverage tool doesn't seem to be capturing the test coverage for the tests located in the directory tests. The actual source files are stored in another directory named src. (For privacy reasons, file names have been altered.) Shown below is the conte ...

What is the best way to retrieve the second to last element in a list

When using Protractor, you have convenient methods like .first() and .last() on the ElementArrayFinder: var elements = element.all(by.css(".myclass")); elements.last(); elements.first(); But what about retrieving the element that comes right before the ...

The exception thrown by Runtime.callFunctionOn was due to an error in LavaMoat - the property "Proxy" of globalThis is not accessible in scuttling mode

As I work on developing a Next.js app, I encountered some challenges when trying to run tests with selenium-webdriver. My webapp utilizes authentication with Metamask wallets, and the issue arises when attempting to import a wallet into a test window using ...

Nightwatch execute() function not technique following anticipate

After reviewing the documentation, I am confident that this code should work correctly. However, I am encountering an issue where something needs to run once the expect has finished, but it doesn't seem to be functioning as expected. Functioning Code ...

concealing your password within a Java class file as part of a testing scenario

I am currently developing a Selenium test case for our company's Jenkins server, where all employees have access to view the Java files I create. public static void main(String[] args) { WebDriver driver = new FirefoxDriver(); driver.get(" ...

Resolving Circular Dependency Error in Angular Component due to Service Integration Testing

Delving into Angular Unit Testing has been a recent focus of mine as I've begun incorporating mock tests in one of my projects. However, I've hit a roadblock with an error popping up in one of my component tests: Error: NG0200: Circular dependency in DI d ...

Testing _document in Next with Jest: A Comprehensive Guide

I am facing a challenge in achieving 100% test coverage for my project. The only file that I'm struggling to test is the one where I have no idea how to begin. Starting from scratch seems daunting. The project is built using Jest and React Testing Librar ...

Strategies for thorough module testing in my PHP application using PHPUnit and Zend Framework 2

I have successfully tested my application module and another module separately. However, I would like to run all tests (both for the application module and the other module) together in order to generate a clover report for Jenkins. What steps should I tak ...

Tips for interfacing with Angular ColorPicker elements using Selenium WebDriver

Is there a way to automate interactions with Angular ColorPicker components using Selenium WebDriver? Since there is no text field input for hex codes, it relies solely on mouse clicks. For reference, you can check out this example: https://www.primeface ...

What should I do when faced with an unexpected alert while using the Selenium Driver?

Currently, I am working on testing the functionality of www.uhc.com using Selenium with Java and Chrome browser. The website includes a random pop-up that appears while the script is executing, prompting the user to take a survey with just yes or no opti ...

When it comes to E2E testing with an Angular, Python, and MongoDB web stack, which tool is more effective: Selenium or Protractor?

Just discovered the protractor framework, which offers end-to-end testing for Angular applications. I'm curious to know which test framework is more suitable for the webstack I am using - Angular, Python, and MongoDB. Should I go with Selenium or Protract ...

Using Selenium IDE to perform comprehensive tests on all website links

Currently, I am in the process of utilizing Selenium IDE for testing a web application. The page in question contains multiple links that trigger modal windows. My goal is to test every single link on the page in order to confirm that they all result in mo ...

What is the most efficient method for retrieving information from this JSON using PHP?

[{"id":"1",name":"Title One","players":"999"},{"id":"2","name":"Title Two","players":"100"}] What is the best way to display this information? ...

Retrieve the current state of the toggle component by extracting its value from the HTML

I have a unique component that consists of a special switch and several other elements: <mat-slide-toggle (change)="toggle($event)" [checked]="false" attX="test"> ... </mat-slide-toggle> <p> ... </p> F ...

What is the process for transferring the test results report from Sauce Labs to the Jenkins dashboard?

Utilizing Sauce Labs with Jenkins for running Selenium functional test cases has been my current challenge. Imagine having a Jenkins CI/CD pipeline in network-1 that connects to a Git repo for code retrieval and then deploys it in network-2. Following th ...

The WebDriver Manager for Selenium Automation is experiencing issues with the latest Chrome update, version 116

I implemented the selenium framework and included this dependency. However, I encountered an issue where the browser wasn't being invoked due to Chrome version 116. <dependency> <groupId>io.github.bonigarcia</groupId> <art ...

Exploring the functionalities of Angular components

I have encountered an issue while testing my class that relies on a single dependency, which is a service. Despite trying various methods such as using stubs, I am still facing the problem of an undefined method. https://i.stack.imgur.com/A3by2.png Testin ...

What is the best way to simulate our services for controller testing?

Currently delving into angular js and experimenting with testing a controller. Here is the service I am using: angular.module('test'){ service.getAllServices = function() { var fullPath = url var deferred = $q.def ...

Having trouble with Autocomplete Mui Testing? It seems like simulating a change isn't doing the

I'm having trouble updating a state's component using enzyme to simulate an onChange event. Below is the code for the component in question: Component: import React, { useState } from 'react'; import TextField from '@material-ui/c ...

Encountering a problem where an error is being thrown when using @driver.quit in the after(:context) block

Currently experimenting with this code snippet require 'rspec' require 'selenium-webdriver' RSpec.describe 'Brand new test' do before :each do @driver = Selenium::WebDriver.for (:firefox) end after :all do @driver.quit end it 'will s ...

Adding Rust to an OpenJDK Docker image

I've been working on creating a dockerfile to run a rust test suite that needs a jar running on a separate port. I have the jar file stored in the project folder and plan to begin with an openjdk docker image, then download rust for testing purposes. ...

Debugging in Node.js - automatic error message generation

Hello, I am a beginner in the world of nodejs (async) debugging and could really use some assistance when it comes to dealing with error messages. var l, m, opiton= {}; // It appears that the variable 'option' has been mistakenly spelled as &apo ...

What exactly does the Test Explorer initiate?

Currently, I am interested in performing tests on a web page front end that interacts with an ASP.NET RESTful Web API using Selenium. My understanding is that when I select "Run All" in the test explorer, it initiates my web server, opens my web page (re ...

What are the steps to checking login functionality utilizing the Facebook and Google APIs?

I am currently utilizing the express framework, along with chai for testing purposes. When it comes to local login, I have been testing by passing data such as {mobile_number, otp}. Depending on the response received, the test either passes or fails ...

Execute data provider tests simultaneously with TestNG

For my tests involving a data provider, I have the following sample code: @DataProvider(name = "testData") public Object[][] testData(){ return new Object[][]{ {"John", "San Jose"}, {"Mike", "Santa Clara"} }; } @Test(dataProvider ...

Creating a Selenium test class in Java to streamline the setup process for multiple tests

I recently came across this informative post that shed some light on my current situation. I have been following it as a guide but encountered a java.lang.NullPointerException, which I believe is due to the page not loading properly, although I'm unsure of ...

Encountering an error in my IntelliJ where I am struggling to import WebDriverWait despite already having the dependencies listed in my POM.XML file

Encountering an issue with WebDriverWait https://i.stack.imgur.com/nQZiL.png Despite adding the dependency in my pom file, I am unable to import it. I am facing an error in Intellij which seems to be related to a Maven repository problem. https://i.sta ...

What is the procedure for printing a list of categories and selecting each category individually in selenium/appium?

How do I print and click on a list of all items such as home top stories, latest news, opinion, etc. in each category, as shown in the image? I tried using the code below but didn't succeed. Can someone please help? List<WebElement> list=driver.find ...

Trying out the fetch api with Jest in a React Component: A step-by-step guide

As a newcomer to test driven development, I stumbled upon a section that talked about testing/mocking a fetch API. However, I am facing issues while trying to write my own test. In order to practice this concept, I created a simple weather app where I atte ...

Uncovered event listener in Angular tests

Imagine having a custom directive: angular.module('foo').directive('myDir', function () { return { restrict: 'E', link: function (scope) { var watcher = scope.$watch('foo, function () {}); scope.$on('$destroy', function () { ...

Testing file uploads with AngularJS unit testsAngularJS unit testing for

Unit tests in AngularJS can easily mock XHR requests using $httpBackend, making it convenient for testing. I recently encountered a situation where I needed to mock XHR for file uploads, but faced some challenges. Take a look at the following code snippe ...

Which would you prefer: tools for recording and playing, or tools based on code/script?

Being new to test automation, I am looking to start implementing it for our platforms (iOS, Android, and Web). Now, the big decision is whether to go with "Record and Play" tools like Ranorex or stick to "Code/script based" tools like Selenium using C# p ...

Issue: StaticInjectorError(DynamicTestModule)[CityService -> Http]: Http provider not found

I am working on a service that retrieves all cities from a web service. @Injectable() export class CityService { constructor(private http: Http, private router: Router, private auth: AuthService) { } public getAllCity(): Observable<City[]> { ...

Is the drop down click feature malfunctioning in Selenium Java WebDriver?

Can someone please help me identify what is going wrong in my code? WebElement dropdown = driver.findElement(By.xpath("//*[@id='idCallType_100']")); List<WebElement> Options = dropdown.findElements(By.tagName("option")); Syste ...

Verify if function is returning sessionStorage using jest

Recently, I've been working on creating a jest test for the function below that sets a sessionStorage entry: /** * @desc create authenticated user session * @param {String} [email=''] * @param {Date} [expires=Date.now()] * @param {String} [hash=''] ...

Generate sample data within a fixture

Currently, I am in the process of working on a project that involves creating users and conducting tests on those users. To generate user data such as first name and last name, I am utilizing the faker tool. My goal is to create a user with these generated ...

msal npm build execution halted due to loader issues

I've been working on setting up msal for use with nodejs. My goal is to verify that emails are successfully received by test users in end-to-end webdriverio tests. Following the npm msal guide here, I made good progress but ran into some errors while runn ...

IDEA runs test successfully, however, when using maven the tests fail to complete

Currently, I am in the process of testing my application using Selenium WebDriver and TestNG. Within my codebase, there are a total of 15 methods that have been annotated with @Test. Interestingly, when I manually initiate the tests by right-clicking on th ...

Discover the best practices for utilizing the npm commands.test function

Looking to create a function that can return the output from running npm test. (this function can be called as npm.commands.test(packages, callback) here) Attempted to use it in this way: var npm = require("npm"); npm.load('', function(err, npm) { npm ...

Issues with Google ChromeDriver not Initializing

Has anyone found a solution to this issue? I have instantiated the driver and opened the browser, but I am encountering the following error: [01:53:15,339] INFO [CheckOut-0] - ####### Test 'MyTestCases.CheckOut' started Starting ChromeDriver (v2.9. ...

A guide on capturing the text content of the error message from the <mat-error> element with Protractor

I have encountered an element that is giving me trouble in retrieving the error message text into a variable. <mat-error _ngcontent-c16="" class="mat-error ng-star-inserted" id="error-email-required" role="alert" ...

Obtain the text using Selenium WebDriver's getText() method

I am currently using Selenium WebDriver's .getText() function in Java to extract some text from a webpage, but I am facing difficulties as the text is not present within the WebElement object. The specific text I am trying to retrieve is: "eNewsletter ...

Why isn't my custom HTML attribute displaying correctly?

In my current React app project, I have been incorporating custom attributes to HTML tags and React components for End-to-End (E2E) tests using Testcafe. However, I am facing an issue where the additional data-test="burger-menu-btn" attribute is ...

Exploring Laravel by running diverse code on a shared database

I am currently in the process of transitioning my application from a custom framework to Laravel, and I am trying to plan how I will approach testing in Laravel going forward. Currently, my testing setup involves: I have my application split into two fol ...

Is it possible to execute Selenium system tests without the need to launch the browser?

Created a test method using Selenium that resembles the following: [TestFixture] public class Test_Google { IWebDriver driver; [SetUp] public void Setup() { driver = new InternetExplorerDriver(); } ...