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
25 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 ...
1
vote
0answers
40 views

How to send nested JSON in cucumber as request

hopping for you help and assistance I'm trying to send nested JSON through cucumber data table , i have the following scenario, I have tried Scenario Outline too, didn't resolve the issue Thanks in ...
-1
votes
0answers
59 views

java.lang.IllegalArgumentException: Invalid number of path parameters. Expected 1, was 0. Undefined path parameters are: Bl51kmlX

I'm testing API, using rest assured, programming language is java, trying to delete the (POST) created product. as you can see in the below deleteProduct method, I'm getting the generated new ID from ...
0
votes
1answer
23 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
38 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
34 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
19 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
31 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 ...
-1
votes
0answers
35 views

Showing error on entering the date .Will some one pls give inputs to get a solution?? Will be helpful if i get inputs

String dayText = dateValue.substring(dateValue.lastIndexOf('.')+1,dateValue.length()); int day=Integer.parseInt(dayText.trim()); String dayXpath = AppXPathsConstants.dateXPath_replace.replace("...
0
votes
0answers
32 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
32 views

Download file in automation at a specific location [closed]

I am automating a webapp using selenium with java and involves downloading of pdf in a specific path. Recently chromedriver.exe stoped opening hence I replaced it with a newer version. But now I see ...
0
votes
0answers
14 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
42 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
30 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
53 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
198 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
28 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
25 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
29 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
40 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
29 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
27 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
34 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
39 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
31 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
343 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
34 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
53 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
vote
3answers
86 views

Avoiding a NPE when checking JSON response using JsonPath and Rest Assured

Given the following JSON: { "priceOne": 1034, "priceTwo": null, "priceThree": 7282, } ...and the following Rest Assured method to get the priceTwo value and ...
1
vote
1answer
20 views

Asynchronous content is not found after button click in Selenium Grid

I have created a script in Selenium IDE that goes to this page: https://www.lexology.com/instructcounsel/find and presses the 'Example' button and then asserts that results are displayed for the ...
2
votes
1answer
39 views

Should Page Objects be reused or should new ones be created?

I am fairly new to using POM and I am wondering if there is a best practice when returning to a previously visited page. Is it better to create a new page object every time there is a page navigation? ...
0
votes
1answer
96 views

How to implement proxy server setting in selenium webdriver using java

I have tried both the below code but unable to set proxy Proxy proxy = new Proxy(); proxy.setHttpProxy("socks5://localhost:8080"); ChromeOptions options = new ChromeOptions(); ...
0
votes
1answer
32 views

How to create correct JSONArray in Java using JSONObject [closed]

I'm trying to create a JSONArray but having difficulties cause the format I need to create is as follows: "header": [ { "name": "x", "id": &...
1
vote
1answer
32 views

Unable to select the text from the drop down

i tried to identify the text from the drop down but it displays the error. Select agentName1 = new Select(driver.findElement(By.id("XYZ"))); agentName1.selectByVisibleText("ABC"); ...
0
votes
0answers
121 views

Anyone had success running TestNg with Java 9 or above?

Has anybody successfully run the TestNG with >=Java 9? I tried and it failed. I also had no luck finding any helpful information from Google search. This is the error I got, Error occurred during ...
0
votes
2answers
29 views

GUI / report for Selenium / Maven test failures

I've got testers starting to work with Selenium / Maven / Java / IntelliJ Idea. Does anyone know if a way I can generate a GUI report of a test's results after it has been complete? Only need to ...
1
vote
1answer
248 views

No such element: Unable to locate element

I am trying to automate a payment using selenium java via a modal. I am able to enter the CC details however when I exit the iframe and try to click the pay button I get the following error message ...
1
vote
1answer
35 views

List issues facing

I am creating script for list but it is all four tab run and when last tab found it's popup it automatically script fails. How to put condition if it is continuously run. Please see my code. http://...
4
votes
1answer
58 views

Which is the correct page object model design and why?

Issue: The target webpage has many buttons in the page and adding separate abstraction for each method like , click button1 , button2 etc feels like unnecessary and just creates additional lines of ...
0
votes
1answer
61 views

Backend test automation framework - Java

I'd like to create and ask about best framework for backend end-to-end tests. This is microservice architecture software and the services communicates via REST API and Apache Kafka. What would be best ...
1
vote
1answer
54 views

Unable to find Javadoc location for selenium version 3.141.59 jar for java version

I installed Selnium for Java version 3.141.59. I am using Eclipse-Neon edition .I was trying to attach javadoc location to the client-combined-3.141.59 jar.can u please confirm if the javadoc URL ...
1
vote
1answer
22 views

How can we handle SeekBar in Appium?

I wrote a code for SeekBar. I wanted to move the SeekBar but it did not move. When I run the code it gives me values in the console but did not move. Kindly check my code and tell me what I am missing ...
1
vote
2answers
210 views

How can we write scrolling code in Appium with Java?

How can we write scrolling code in Appium with Java? Here is what I want to do, Open the application. Scroll down to the footer. Scroll back up. This is the code that I have written: base.java ; ...
0
votes
1answer
41 views

I am unable to login

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; public class testClass { public static ...

1
2 3 4 5
27