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
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 ...
Yan's user avatar
  • 11
-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 ...
user56056's user avatar
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 ...
user56056's user avatar
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 ...
ChathuD's user avatar
  • 2,099
-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
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....
javabeginer's user avatar
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&...
javabeginer's user avatar
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....
javabeginer's user avatar
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. ...
javabeginer's user avatar
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, ...
mt85's user avatar
  • 11
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']")); ...
user56056's user avatar
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 ...
user56056's user avatar
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....
javabeginer's user avatar
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+ (...
RonyPatricks's user avatar
0 votes
1 answer
14 views

Getting NullPointerException while running the simple testNG script

Code as below: Public class sample { @Test Public void test() { Syso("hi"); } }
user55826's user avatar
0 votes
2 answers
131 views

Facing challenges to run java selenium tests with gitlab runner

I am trying to run cucumber maven tests on gitlab ci using selenium grid, from the output I have observed that containers for grid setup are up and running. But I am not able to run my cucumber tests ...
SRM21's user avatar
  • 289
0 votes
0 answers
55 views

Not able to run selenoid tests with gitlab using dind for java maven tech stack

I am relatively new to gitlab and selenoid. I have been trying to run my tests on selenoid with gitlab and below is what my gitlab-ci.yml file looks like: image: maven:3.8-openjdk-11 variables: ...
SRM21's user avatar
  • 289
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(...
Vighnesh Ransing's user avatar
-1 votes
1 answer
28 views

For Android testing (using Java), is it better to have Accessibility IDs put in, or will Element IDs or just "id" suffice?

An Android app to be automated tested has no Accessibility IDs (aka element's content-desc attribute) whatsoever. I'm hearing that it would be good for the developers to put this in, but I've also ...
ackmondual's user avatar
1 vote
1 answer
250 views

Differences between Resource ID, TestID, Element ID, ID, and Accessibility ID?

This info is so scattered across some of my searching. However, I'd like to get the community's knowledge on this. Especially for the purposes of locating elements in code (Appium, testing Android app,...
ackmondual's user avatar
0 votes
2 answers
63 views

how to automate a date picker that not in a table tag

I want to automate that starting date and end date but in DOM I can't find a Table tag for date picker so I don't know how to locate the field. The tag is <input class="inputvd" type=&...
Anish subramanian's user avatar
-1 votes
1 answer
130 views

How to validate invalid date error message in Selenium Java project?

I have a "Date" field on my page I want to automate. Now, when I enter invalid value or invalid format, then its displays an error like: "This is invalid value for "Date" ...
qatester249's user avatar
0 votes
0 answers
171 views

Cucumber TestNG Gradle Parallel Execution ThreadCount

I am trying to run my Cucumber scenarios in parallel using the TestNG. But when I run it 'parallel=true' it executes the test cases in thread count=10 (testng default). I want to customise the thread ...
Alok's user avatar
  • 760
0 votes
0 answers
12 views

How to terminate the application and make the launcher return to its call by the stop command?

In question: Need code examples on how to use org.junit.platform.launcher.listeners problems have been resolved: Exit – program interruption Pause (true) – stops work before receiving Pause (false) ...
DinaD's user avatar
  • 13
0 votes
1 answer
106 views

Need code examples on how to use org.junit.platform.launcher.listeners

I run according to the documentation with a test class with 30 tests inside org.junit.platform.launcher.Launcher I have a function launcher.registerTestExecutionListeners(listener) registered in org....
DinaD's user avatar
  • 13
2 votes
3 answers
118 views

How to validate if .txt file format is correct as a part of File processing in Automation framework?

In my Selenium+Java automation framework, I need to open a .txt file or any other extension file and then see if the text is in a particular format. Now, I need to see if all lines are in this format ...
test0023's user avatar
-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 ...
Dhamotharan's user avatar
0 votes
2 answers
665 views

How to load Config.properties file in Cucumber TestRunner.java file?

To run my Selenium/Cucumber java project, I need to pass some VM arguments, variables, properties path etc... now easiest way is to pass it in Eclipse run configuration under "VM arguments" ...
danny234's user avatar
-1 votes
2 answers
86 views

Is it mandatory to return a PageObject instance in every Page Object save/submit method?

In the Page Object model, we separate page UI elements and Test methods. However, there is a concept of Page chaining, in which we return an object on the next Page Object in the previous page object ...
abhi235's user avatar
0 votes
4 answers
159 views

Selenium email automation

I'm trying to automate tests using Selenium and a Yahoo email address. The problem is when I run my test in Azure DevOps I face the CAPTCHA privacy terms. Any ideas on how to fix this problem?
Ghofrane Chakroun's user avatar
-1 votes
1 answer
69 views

Javawith selenium

[RemoteTestNG] detected TestNG version 6.14.3 [TestNGContentHandler] [WARN] It is strongly recommended to add "<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >" at ...
varshini's user avatar
-1 votes
1 answer
40 views

Verify that 4 products are shown with € symbol

I want to verify from this website: https://demo.nopcommerce.com/. There are 4 products shown with the Euro symbol by using for loop. Code: List <WebElement> productcurrency = driver....
Esraa Emad's user avatar
1 vote
1 answer
63 views

How to Switch frame in Selenium java

I'm trying to switch frame to email body, but it's not working. I'm not able to switch frames. Expectation: I need to open yopmail and get a text from second email. Email - Secondemail1234@yopmail.com ...
Siva's user avatar
  • 11
-1 votes
2 answers
68 views

How would you prioritize these bugs, and why? [closed]

Here is a hypothetical scenario for a software quality assurance (QA) logical question: You are a QA engineer testing a new feature for a web application. The feature allows users to upload and share ...
Hardik Kanajariya's user avatar
1 vote
4 answers
146 views

Selenium Test cases for UI look

I have a test case, where I need to verify: a user selects any of the options. the text is not going out of the layout and displays complete readability to the user. As a result, the UI look and ...
Ghofrane Chakroun's user avatar
0 votes
1 answer
159 views

ExtentReports doesn't save the screenshot with the report

Hello I am trying to capture screenshot of failed test cases using selenium webdriver with Maven and TestNG with following code, it does generate the screenshot in my project but doesn't get included ...
Ami's user avatar
  • 21
0 votes
3 answers
663 views

perform button click if specific element is present

I have a product list and some products have discount available. I want to click buy if discount price text is available. Below is a product with discount <article class="commerce-product--...
Darshani Kaushalya's user avatar
0 votes
1 answer
765 views

Test has been compiled by a more recent version of the Java Runtime (org/testng/annotations/TestNG)

I found my issue below when using this dependencies: </dependency> <dependency> <groupId>io.appium</groupId> <artifactId>java-...
barzilai zio's user avatar
0 votes
4 answers
422 views

Verify element is visible using selenium and java

I am trying to identify a specific element and perform some actions. This specific element is not available in every element I am looping. Below is the element I'm trying to catch. <span class=&...
Darshani Kaushalya's user avatar
0 votes
1 answer
248 views

Verify search results using boolean value in if else

I have to automate the functionality of search.There are 2 possible out comes. one is result is generated the other is results not found. if there are matching results to search criteria a new div ...
Darshani Kaushalya's user avatar
-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....
Sachin 's user avatar
0 votes
0 answers
12 views

how to locate element on a new window that pops up from a primary window [duplicate]

I am running a test on a story for payment, and when it gets to the page, a third party (Klarna), I was unable to locate the element from the new web page from the third party. Could it be because the ...
Tosin Adeleye's user avatar
0 votes
0 answers
424 views

Cucumber .Hoook class is throwing errors due to not having an empty constructor

I've been struggling with this issue all the day and no way for solving it. The thing is that if I put a non-empty constructor (with the context) for the .Hooks class, there is an exception of the ...
Pedro Santangelo's user avatar
1 vote
1 answer
2k views

Log4J2 is not printing message from Log.info()

While writing the below code, no message is being printed on the console for logger.debug(), and logger.info() methods. package log4j2.test; import org.apache.logging.log4j.Logger; import org.apache....
Ketan Patoliya's user avatar
0 votes
1 answer
222 views

how to validate empty screenshot in selenium webdriver

Is there any possibility to check empty or blank screen shots. Sometimes, the screen shot is blank when am using TakesScreenshot ss = (TakesScreenshot)driver;
Raji's user avatar
  • 1
0 votes
0 answers
69 views

unable to locate and Element after else condition

i have provided the condition when in if it works fine and after accepting the condition it is coming out of the loop and finding elements.but after executing else condition it is not finding the ...
sabeeh's user avatar
  • 1
0 votes
0 answers
22 views

How to reduce execution speed by using gitlab runner

I have a GitLab repo with selenium 4 TestNG tests. They run on 4x8gb runner. It has a pipline that compiles runs sanity check, downloads drivers and then push it, for next 3 parallel jobs to download ...
RafalLovesWorking's user avatar
7 votes
1 answer
453 views

Selenium + Java: How to get the OS, and Browser details on run time?

What I want to do is, while I'm running my tests, I want to get the current, Operating System Browser Name Browser Version This is for making the details clear in the test/bug report. I haven't ...
RonyPatricks's user avatar
0 votes
2 answers
298 views

How to end the if condition if ,if condition keep failing all the time

I have the below method in my code to check if a text was updated on the web page. As for the code, I will keep refreshing the web page until the text changes to "Hot" and call the same ...
ChathuD's user avatar
  • 2,099
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 ...
Samian's user avatar
  • 21

1
2 3 4 5
29