Questions tagged [java]

Questions about testing applications written in Java or test automation written in Java, a popular programming language and runtime environment which allows Java programs to run unchanged on most hardware and software platforms.

Filter by
Sorted by
Tagged with
1
vote
1answer
29 views

Should we write a Test Case for every Foreign Key?

Should I write a test case for every Foreign key in the database? Our team is conducting a large database migration project using Java APIs, for eg. inputting CustomerSales. And we have ProductId, ...
0
votes
1answer
21 views

Selenium Java best practices for handling different languages and locations, and setting dynamic architecture

Im currently working on a platform that has multi-language options and also the language is defined by IP. So Im trying to build an architecture for testing both scenarios dynamically... The domain is ...
0
votes
1answer
18 views

On selecting the radio button how to get the text of the selected radio button where the text is in the next column

On selecting the radio button how to get the text of the selected radio button where the text is in the next column I randomly select the radio button and then i need to Store the selected Radio ...
0
votes
1answer
21 views

Cucumber - Accessing injected context in After scenario hook

I'm attempting to refactor a test automation framework I have inherited (Java, Selenide, Cucumber) from one that uses static global state for test data, to context injected test data using ...
-1
votes
0answers
32 views

I have a Dynamic WebTable where i need to select any Two chekbox randomly how to do that

Scenario: I have a WebTable where i go and enter the Search Criteria and based on the Search Criteria the Matching records appears. Then i Need to select 2 checkbox from the table . My Question is - ...
0
votes
0answers
20 views

How can I copy authorization code from Yopmail

I am automating my script in Selenium webdriver with Cucumber. Now I have to verify an activation code from Yopmail. How can I go to youmail and copy the code and came back to script and paste?
0
votes
0answers
43 views

how to select the id that is just added and take that id and use it in another screen

My Scenario: I need to create a Demand. After creation the Id of the Demand will be autogenerated I need to fetch that id and use it in another screen Question: While I created the Demand and try to ...
-1
votes
0answers
26 views

How to fetch the most recently added Date from the table [closed]

Scenario: I have a Screen where i need to enter the Date by incrementing the Date by 10 days .... After entering the Date and saving the entered Date could come anywhere in the table. My Question is ...
1
vote
1answer
31 views

Is Cucumber Scenario equivalent to a Java Class?

@Add User Scenario: Add a new User profile in the System Given user is on the Add User profile page Then Add a new user profile in the system Then verify that user has been added successfully Now, ...
0
votes
1answer
41 views

Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver

I've added all JARS configured chromedriver. Why this error is coming "Error: Unable to initialize main class Practice.test1 Caused by: java.lang.NoClassDefFoundError: org/openqa/selenium/...
0
votes
1answer
20 views

Why dont we use the main() method in TestNG class?

public class Tests{ @Test public void run(){ sop("this is test method 1"); } } How will Jvm know about entry point of the program? 🤔
0
votes
0answers
25 views

How do I select the li element from dropdown using java in selenium

Below are the code which I used: driver.findElement(By.xpath("//div[@class=' flag-dropdown']")).click(); WebDriverWait wait = new WebDriverWait(driver, 10); List<WebElement>...
0
votes
0answers
16 views

Make the appium code for swiping dynamic so that it works on all screen sizes

I have a piece of appium code (as below) which does the swipeup action on one android device using co-ordinates(using the coordinates as the element is non-responsive). Is there any way to make it ...
-1
votes
0answers
24 views

I have a table where i need to add 8 rows and select the dropdown value in the first field and enter input values in the second and third field

I have a table where I need to add 8 rows and select the dropdown value in the first field and enter input values in the second and third field Table: The table has 3 fields First field is a dropdown ...
0
votes
0answers
29 views

TestNG parallel execution get failed becouse im using same WebDriver on all tests

There is a situation where I have 150 test cases and I have set up Test NG parallel test execution. Unfortunately, I'm using the same web driver which initialized at the test base class on all the ...
0
votes
1answer
24 views

Unable to run test on gitlab pipeline due to DevToolsActivePort file doesn't exist

I created a sample Selenium Webdriver test using java and maven and pushed it out to my gitlab repository. Then I created a new pipeline to run the automated tests. This is my first time running a ...
1
vote
0answers
15 views

Java Swing MVP unit testing with Mockito

Description I have a simple Java Swing application implementing the Model-View-Presenter pattern. My aim is to be able to test the logic behind "rendering" the view. Here is the presenter ...
0
votes
0answers
21 views

Jenkin fail without explanation running tests process exitcode 143

I have multiple test suites running on jenkins, however there is only one which never completes. It gets interrupted but never shows why The only thing I see in my console of the build is this: 04:13:...
0
votes
1answer
25 views

Whatsapp Web QR code Scanning using Appium Java

I have a company in-built web application that behaves similar to WhatsApp web. I need to link/scan using QR code of WhatsApp mobile application with company inbuilt web application using Appium with ...
1
vote
3answers
65 views

How to open outlook and click on the link that is there in the mail using seleniumn

In my application I need to send a confirmation after which an mail will arrive to my Outlook which I need to open and click on the link which is sent in the mail. Can someone please let me know if ...
0
votes
1answer
69 views

How to send nested JSON in cucumber as request

I'm trying to send nested JSON through Cucumber data table. I have the following scenario, I have tried Scenario Outline too but it didn't resolve the issue. Scenario: provider edits new ...
0
votes
1answer
25 views

how to insert generated id from response , into the endpoint

I'm testing API, using Rest assured, programming language is java. Is there any way to get the generated id from a response body and insert it into the endpoint? I have the following endpoint {baseUrl}...
1
vote
1answer
44 views

Where do we keep integration tests in microservices projects?

Let's suppose we're talking about a microservices project. Then we usually have different repositories for each microservice. Unit tests, component tests (low layers of test pyramid) are often kept in ...
0
votes
0answers
38 views

Is mock data in unit tests feasible?

I am implementing an abstraction layer that basically translates Hibernate criteria into my data model. I am trying to apply TDD but test fixtures are Hibernate criteria objects, hard to get without a ...
0
votes
0answers
8 views

Can I reuse automating acceptance testing framework for JavaFX and SWT?

I'm investigating acceptance tests for my company that has a number of applications served via a JavaFX and SWT GUIs. In the future SWT apps will probably be rewritten to JavaFX. I am investigating if ...
0
votes
1answer
41 views

how to add "\n" to the method

I have the below method: PUBLIC methodname(WebDriver driver,formEntryMap<String,String>,String Colkey) { String Xpath = This will have the xpath of the input text box inputfieldEntry(driver,...
0
votes
1answer
45 views

Unable to locate pseudo element using javascript executor in Selenium JAVA

I am currently having issues with locating an pseudo element for a web page. I have checked other articles to use javascript and tried but it still isnt getting it. Below is a screenshot of what the ...
0
votes
1answer
41 views

Does Selenium FindBy annotation accepts value from object repository?

I am wondering whether @FindBy annotation accepts xpath from properties or object repository file? and also please let me know , what is the practical approach ? a. Using Page object model having all ...
0
votes
0answers
72 views

How to import and configure cucumber reports into build.gradle

I am unable to import the ReportBuilder and Configuration classes from net.masterthought.cucumber within my build.gradle file; they show as follows in my build.gradle: Here is my build.gradle in full:...
0
votes
0answers
16 views

MatcherAssert fails on popup modal

I have a script that goes to a page, clicks a button and then uses a MatcherAssert to check I am getting the right messaging on a gating modal. Here's the script: package com.lbr.testcases.lexology....
0
votes
0answers
57 views

Should my logger test its Readers for byte order marks / char encodings, or is this considered clutter?

I'd prefer to always check a newly opened Reader for a "byte order mark." If given, log that as the char-encoding or log "char-encoding assumed utf8." If there is a BOM I might be ...
-1
votes
1answer
34 views

Not able to click() on newly added account number from a account list on the page

A new account is created using selenium script and a message appears that "Account is created successfully : <***12345>" After this, Account page is displayed where all the accounts ...
0
votes
0answers
84 views

How to perform mouse hover in selenium java using page object model approach?

I have automated some test cases mentioned at https://www.techlistic.com/2019/08/automate-buy-product-using-selenium.html For second test case mentioned at given link, I have written code for mouse ...
0
votes
2answers
36 views

I want to scroll to a specific location Selenium Java

I have a list of webelements, I have written the below code: List <WebElement> feature_tiles = driver.findElements(By.xpath("//div[contains(@class,'featuretile')]//a")); System....
0
votes
2answers
57 views

deserializing response body in java

I'm testing API with Rest Assured, I have all the necessary dependencies, all setup, the only question is, I have created all POJO classes for Request Body, I'm in the phase, where I have to verify, ...
0
votes
2answers
379 views

Iterate through multiple URLs in Selenium

I have to use multiple URLs in same script in Selenium (Java) and have to visit one at a time, perform some operations on the page take a screenshot at the end, and then move one to the next page and ...
0
votes
1answer
30 views

java.lang.NullPointerException,at ✽.Given product is set with the following fields(src/test/resources/features/wizard/wizardNewProduct.feature:

Pls, I need help, I'm getting a null pointer exception, When I send a request, I'm catching values in Cucumber through the List<Map<String, String>>. I'm testing API with Rest Assured and ...
0
votes
0answers
28 views

How to type/send values to fast-monaco-editor

I tried clicking on the field and typing values. Actually the field is getting clicked but its not typing values. I am working on protractor Selenium Java framework. Sharing below the code I used ...
0
votes
1answer
30 views

Preparing script for running on server

I'm new here and want to share my experience with you. Till now I didn't have any experience in running my Selenium Java automation script on a server, but now I have a problem: I cannot find more ...
1
vote
1answer
45 views

How to handle below slider option using Selenium Webdriver in java

I can't imaging how to handle below type of slider option using selenium with java. There is no different xpaths for dropping locations. There should be different xpaths to use below option Actions....
1
vote
1answer
37 views

AllureRestAssured , how to ignore logging headers

I am using rest-assured and allureRestAssured for testing api given().header("Content-Type", "application/json") .header("key", key()).filter(new ...
0
votes
0answers
13 views

Not able to blacklist header value [duplicate]

Hi I using java and testng for my test suite and allure report for reporting , issue is I am not able to figure out how to implement condition where Blacklist specific header value Logged response ...
1
vote
1answer
90 views

Excel Reader - How to read numeric and string values from Excel file? [closed]

static Workbook book; static Sheet sheet; public static Object[][] getTestData(String sheetName) { FileInputStream file = null; try { file = new FileInputStream(TESTDATA_SHEET_PATH); ...
1
vote
1answer
38 views

Waiting for two events in Selenide

I have code, written on Selenium which waits for the first or for the second event. But all testing framework uses Selenide. The question is how to rewrite such code on Selenide, to avoid unxpectable ...
1
vote
1answer
37 views

Click on table row if text String is found

I have this Angular component implemented as a table: <div _ngcontent-nyg-c4="" fxlayout="column" class="feature-content" id="content.rowify" style="...
-2
votes
1answer
41 views

What is the best architecture for a test automation framework with multiple products?

Currently we have time for updating architecture in our test automation framework and we searching for the best solution to our needs. We have this module architecture: tests-core core-api core-web ...
0
votes
0answers
32 views

NullPointerException-webdriver null

I put a screenshot with getDriverInstance. After run. When I run the test, I get this error. At debug it tells me that the webdriver is null. Can anyone help me with a solution how to fix the problem? ...
2
votes
2answers
532 views

Handling cases where a JSON Key exists or not

I'm using rest-assured to test an API. I want to handle a scenario where a key might not exist Given: { "shop":{ "shopId":1892929, "name":"bobs shop"...
1
vote
0answers
36 views

App crashed when give back action continuously - shared preference error android

I have to do back action continuously, app crashed. It shows: "Attempt to invoke virtual method 'android.content.SharedPreferences android.content.Context.getSharedPreferences(java.lang.String, ...
0
votes
0answers
63 views

Android - View pager back function not working in first two tab

I have used viewpager with tablayout in activity.It have 3 tab, The issue which faced is when selected tabs 1&2 back button is not working,and its not able to go to the previous activity. And, in ...

1
2 3 4 5
27