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
0 votes
1 answer
49 views

Java selenium - null pointer exception on webDriver inheritance

I am getting null pointer exception. Would you be able to help and what should be fixed ? java.lang.NullPointerException at pages.LandingPage.acceptConsent(LandingPage.java:14) at stepDefs....
2 votes
3 answers
12k views

How to get the page size (content rendered) in selenium webdriver?

Background : Web page get blank (So script fails as there is no element to locate, only blank page) during selenium script execution in random place only on staging server while same working on ...
0 votes
1 answer
199 views

Getting this error when i run my java appium script

When I save and run the code the compiler is showing error with respect to DesiredCapabilities I thought I might have made an error while importing the jar so I uninstalled everything and installed it ...
0 votes
3 answers
119 views

How to get content of an clickable element in Selenium?

Facing issue to read content after clicking an element in Selenium. I have tried with below code: if(webElement2.isDisplayed()) { webElement.explicitWaitToClickElement(4,webElement); ...
1 vote
6 answers
11k views

Unable to click button using Selenium Webdriver Java

I am trying to click a button through webdriver. After inspecting the button element it highlights to the following: XPath: /html/body/div/div/main/div/div[2]/div/div[2]/table/tbody/tr/td[4]/form/...
1 vote
2 answers
1k views

Click getting to lower item (under dropdown) instead of dropdown in Selenium

I m trying to click on the dropdown menu item and i am able to select the dropdown and the menu item but instead of clicking on item the click is going to the element right under it. Before the ...
2 votes
2 answers
419 views

Not able to match ChromeDriver version with chrome version

So at my current job I’m at a pinch, we can’t just download executable jars and use them. We have to request to download whatever we want . So the problem is , our chrome gets auto updated where as we ...
0 votes
0 answers
11 views

Ashot compatibility with Windows zoom

When i try to use Ashot to take screenshots of errors on my pc i have a probleme where the images of the website arent taking completly. What we have when we execute the code : What we want : When i ...
1 vote
2 answers
8k views

How to read numerical cells without converting to scientific notation (reading excel using Apache POI)

I am trying to read an excel file and validate the values. While reading one of the columns which has decimal values, the digits after the decimal point are not correctly retrieved. Suppose, I am ...
0 votes
2 answers
2k views

While reading repository properties file getting error response as: The method click() is undefined for the type Object

Code isn't able to read Properties file. It returns validation error message in response; The method click() is undefined for the type Object Properties obj = new Properties(); FileInputStream ...
1 vote
1 answer
182 views

How to extract adb dumpsys response for validation?

I need to validate few status of the android device. Can any one let me know how to extract the information from adb dumpsys and validate the responses using Java. Your help is much appreciated. Ex: '...
0 votes
3 answers
3k views

I am not able to ctrl + click on feature file in Cucumber step definition, definition not found error

Help Me I have installed Cucumber and Natural but my feature file is not getting highlighted after clicking ctrl + click. Also, it has highlighted with yellow color While running Test Runner, it says ...
-1 votes
1 answer
21 views

I have a method where i have taken the rowcount of 10 records on page load and 15 records after changing the page no to 15 question how to validate

I have a method where i have taken the rowcount of 10 records on page load and 15 records after changing the page no to 15 question here is how to validate by creating a Assert method seperatly in ...
0 votes
1 answer
44 views

Calender is clicking on the next button getting element click intercept exception it just clicks once on the next button in the calender

Steps: I am trying to click on the Calendar and select the Date from the Calendar and also select year and month but it just clicks once in the next button after opening the calendar and leads to ...
-2 votes
2 answers
83 views

What is a NullPointerException, and how do I fix it?

My test automation returns NullPointerException. What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them? What methods/tools can be used to determine the cause so that ...
0 votes
0 answers
27 views

Unable to locate an element when "show user agent shadow DOM" is enabled

As for the image, I need to capture an element which is under show user agent shadow DOM. I tried using //*[@id="placeholder"], but as for the image, its Zero matches. By looking at some ...
-1 votes
3 answers
124 views

java.lang.NullPointerException - at com.qa.factory.factory.DriverFactory.init_driver(DriverFactory.java:26)

public class DriverFactory { public WebDriver driver; public static ThreadLocal<WebDriver> tlDriver = new ThreadLocal<>(); /** * This method is used to initialize the threadlocal driver ...
0 votes
1 answer
101 views

ScreenShot taken isn't of what's showing in the screen, but rather that of the header until a page size

When I try to take a screenshot, I added a scroll so that it can take a significant screenshot and not only the header. Right now, the picture is still taken from the header/top of the page. Am I ...
0 votes
0 answers
30 views

Java Cucumber - junit does not run any test

could you tell me why "mvn test" or "mvn verify" does not run any test ? Maybe any dependency is missing ? package cucumber.Options; import io.cucumber.junit.Cucumber; import io....
1 vote
1 answer
604 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 ...
0 votes
2 answers
52 views

Java selenium - pretty cucumber reports not generated with screenshot

could you tell me how to generate pretty html reports with screenshot ? After I run the test the "cucumber-reports.html" does not exist. Only "image.png" file is generated. ...
0 votes
1 answer
169 views

Java maven - IllegalArgumentException: Input must be set

I get the following errror when I use git bash command - however when I run the test in Intellij everything works fine and test starts. Could you help ? mvn test -Dcucumber.filter.tags="@desktop&...
0 votes
1 answer
65 views

Calculate the total of liabilities and check it is matching with the given value

I want to calculate the total liabilities amount from webtable and need to compare with the total amount which is present on webpage. I got the following error : Illegal/unsupported escape sequence ...
0 votes
1 answer
849 views

Winapp driver not support web elements

I'm automating my Windows application. I'm using Winapp driver and Java language for automation. I am capturing the web elements using UI Spy Tool. My application is loading, still I can't ...
1 vote
1 answer
736 views

Compare 2 JDBC response in Jmeter

I want to compare 2 JDBC responses: I have Source reponse from 1 JDBC request as below in table format: (Source DB)JDBC Response response1: (Target DB)JDBC Reponse 2: I am saving the response as ...
0 votes
0 answers
18 views

Java Cucumber - pretty html reports net.masterthought - No JSON report file was found

I get the following error when I run the code About to generate Cucumber report. May 02, 2023 6:55:06 PM net.masterthought.cucumber.ReportBuilder generateErrorPage WARNING: Unexpected error net....
1 vote
2 answers
41 views

WebDriver linkText with CSS manipulations

I have an HTML with the following element: <a href="index.html" style="text-transform: uppercase;">index</a> I'm using selenium-java 4.8.2, Chrome 112 and JUnit 5.9.2, ...
0 votes
2 answers
187 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
2 answers
1k views

How can I store a value as global variable from an API response and pass it to another API as parameter in Cucumber feature file using REST assured

I am designing automation scripts using the Cucumber BDD framework for REST APIs using RestAssured. I have one API which generates the "Token" and then there is another API for order ...
0 votes
0 answers
19 views

Have a Screen whereI once click on the text box the up and down arrow will become visible to click but it is not clicking and is not throwing a error

I added this piece of code: Any inputs to get this working would be helpful WebElement inputElement = driver.findElement(By.cssSelector("input[type='number'] [formcontrolname='sample']")); ...
0 votes
1 answer
2k views

How to read the row number with having column data?

I'm automating an app and using winappdriver tool with java language for the same. I am selecting a row and clicking on that row in GUI. Here I am trying to delete a row. So I have a sequence number ...
0 votes
1 answer
90 views

Getting java.lang.IllegalArgumentException: Keys to send should be a not null CharSequence as the stored value returns null Any leads would be helpful

Scenario: There are 3 fields in the Screen where i enter a number in the 1st field text box and i need to enter the same number in the 3rd and 4th text box as well ///So in this case i have created ...
0 votes
3 answers
300 views

In the screen how to navigate to the row which contains the text that needs to be Edited and then click on Edit button.Can some one pls guide.NeedHelp

In the screen how to navigate to the row which contains the text that needs to be Edited and then click on Edit button. Scenario: I have a screen where I need to find the row which has the value as &...
0 votes
3 answers
224 views

Not able to enter case-sensitive credential in android app

I am writing a test case for an android app where the app requires case-sensitive credentials. I writing test cases using appium and TestNG. Steps I am following are - Launching app Entering ...
0 votes
1 answer
86 views

Fetch paid Amount value from iframe

if(ScenarioName.equals("MoveinwithVantivCard")) { driver.findElement(By.id("btnsave")).click(); // driver.switchTo().frame("paymentIFrame"); driver.switchTo().frame(driver.findElement(By....
0 votes
4 answers
1k views

Launch FireFox custom profile with geckodriver in java

I'm trying to launch a Firefox profile with add-ons in it, with selenium v3.12 and gecko-driver v2.10 and Firefox version 60.0, how-ever it seems that the custom profile is not working. below is my ...
1 vote
1 answer
2k views

How to select a dropdown value in Selenium WebDriver using Java appium?

I am new to Selenium, currently am working on selenium webdriver. I want to select a value from the drop-down. But I am not able to do it because of some error. Also, I want to inform you that in my ...
0 votes
1 answer
1k views

Driver switching from one class to another

In the following code, I am trying to get my driver from the class A to class B. Class B can't have a constructor and I tried making a base class, but either Class A gets driver null or Class B gets ...
0 votes
1 answer
1k views

Import TestNG results from Jenkins to ALM

I have Jenkins on localhost, configured test project, which is generating passed test: @Test public void aFastTest() { System.out.println("---- ---- ----"); Assert.assertTrue(...
-1 votes
1 answer
1k views

I'm stuck with the following "error java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "browserName" is null"

I can't identify any issue with the code, can someone help me package com.ai.qa.base; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java....
0 votes
2 answers
769 views

Count all elements with the specific resource ID on the scrollable view

Here is the question. How can I count all the elements with the resource ID body_bubble on a scrollable view ? When I use the driver.findElements (By.id ("body_bubble")).size() method, it gets only ...
2 votes
1 answer
264 views

Selenium latest version is not able to launch FireFox browser in Ubuntu 20.04

I'm trying to automate web tests with Selenium and Java in Ubuntu OS. Earlier versions of Selenium used to work very well with older version of Firefox in Ubuntu. Since I upgraded to Selenium 4+ (...
4 votes
3 answers
5k views

How do I disable 'show all' download bar of chrome in selenium

I need to disable 'show all' download bar of chrome in selenium. Because the download bar is showing, UI elements in the lower portion of my page that need to be clicked are not visible. I'm looking ...
0 votes
1 answer
3k views

Maven TestNG multiple suites in different folders

I'm working on a mobile automation task where I need to run test suites in parallel for 3 different iOS apps. Each test suite has its own testng.xml with a section configured to run on a device. I ...
0 votes
1 answer
3k views

I want to write Java code in Jmeter to copy current date in a variable and use this variable in next request. Where should I write it?

This is my code: package dateTime; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.LocalDateTime; import java.time.format....
1 vote
4 answers
2k views

How to get XPath for the text after the <b> tags

I Need to get XPath for the following, to get the text after the <b> tags <li class="SpacedOut"> <b>Name 6:</b> "ABC" <b>Name 1:</b> "BCD" <b>Name ...
0 votes
2 answers
208 views

I am automating coop website and I'm facing problem while customizing XPath for add to cart button

I have customized an XPath for adding a product which has discount 30% for 2. Now I am facing problem while adding this into the cart. package sample; import java.util.ArrayList; import java.util....
0 votes
1 answer
87 views

Selenium Couldn't identify App crashes Android

Sometimes app crashes. But Selenium can only handle "noSuchElementException" or "TimeOutException". Does Appium runs a listener or something which tracks if the app is crashed? I ...
0 votes
1 answer
365 views

org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: move target out of bounds

I am passing input to rich text field. For that I have written the code below: public void inputToDescriptionField() throws InterruptedException , AWTException { wait.until(...
1 vote
3 answers
158 views

Window handling in java selenium

Successfully handled the child window in java selenium but the cursor is not moving forward to the password field. My code is below package perfect; //import java.util.Set; import org.openqa....

1
2 3 4 5
29