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
1answer
27 views

Type mismatch: cannot convert from WebElement to WebDriver?

Type mismatch: cannot convert from WebElement to WebDriver Getting this error in my code why? package testcases; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium....
0
votes
1answer
21 views

Can we Drag and Drop multiple desktop images at the same time to web page using selenium - Java through script ingestion

I found the below article for image upload using script ingestion. But this script is working for a single file at a time but I want to drag and drop multiple files at the same time. My client doesn't ...
1
vote
1answer
33 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
votes
1answer
64 views

Custom Framework for Writing a Test that Reads a CSV File into a HashMap

I am trying to complete a lab where we are asked to write a unit test that can read a csv file into a hashmap. So far I have this: import java.io.BufferedReader; import java.io.FileReader; import java....
0
votes
0answers
28 views

Unable to capture the element using xpath

I'm trying to capture the dynamic code using xpath(Selenium+Java). I want to get that code and store. but it is capturing and always gives no such element exception.my xpath looks like below when ...
0
votes
0answers
12 views

How to send text to shadow element using javascript in selenium Java

Element is inside shadowroot. Both ways not working Can anyone help here. Shadow element stored in element named variable and need to enter text in the description field. driver.executeScript("...
0
votes
1answer
40 views

Is there a free API for spell and grammar check?

I'm a QA automation engineer looking for a free API or a website for grammar and spell check to automate checks for those errors in web app using Selenium and Java.
0
votes
1answer
48 views

How to execute Selenium script from Linux terminal

I created a .bat file in Windows and launching it from the Windows console and it worked perfectly. Now I got a requirement to execute it from Linux so the .bat file doesn't work, after searching I ...
0
votes
1answer
21 views

Can someone please help me with keyboard shortcuts using Selenium + Java on webpage?

I have tried using actions class but still not working Actions action=new Actions(getDriver()); String ctrlY=Keys.chord(Keys.CONTROL,"y"); action.sendKeys(ctrlY); Actions action=new ...
0
votes
0answers
131 views

Chrome Driver Maven Error "org.openqa.selenium.SessionNotCreatedException: Could not start a new session."

I am trying to run a selenium-based java test application on Intellij using maven. The problem is that if I run the test in IntelliJ the chrome driver starts and run successfully whereas if I Exeecute ...
-1
votes
2answers
115 views

I am stuck with null pointer exception in page object class

Base class package resources; import java.io.FileInputStream; import java.io.IOException; import java.time.Duration; import java.util.Properties; import org.openqa.selenium.By; import org.openqa....
0
votes
1answer
21 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
1answer
25 views

Override Static Method for TestNg Class

Is there a way to add a screenshot in this Assert method? When my softAssert fails, I need it to take a screenshot here. Method of Assert.class : static public void fail(String message) { throw ...
0
votes
1answer
37 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
0answers
15 views

ScreenShot when failed not taken Selenium

I am trying to take a screenshot of the page when an exception is triggered. My main Class : @Listeners(CustomListener.class) public class AjoutPanier extends Base { @BeforeTest public void ...
0
votes
0answers
21 views

Target selectors in empty iframe with selenium JAVA

So there is an iframe on my page, I have no troubles switching to the iframe itself. The problem is I can't interact with its (text)fields since the iframe is empty (no source). iframe source code: &...
0
votes
0answers
21 views

I have a list with Incident numbers. I want to run a test case for each of the incident. How to pass the values from list into Cucumber feature file?

I have a list with Incident numbers. I want to run a test case for each of the incident. I get the list from an excel file during execution. How to pass the values from list into Cucumber feature file?...
0
votes
1answer
26 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 ...
1
vote
4answers
62 views

Should automation scripts made in Selenium always contain wait calls?

Should the automation scripts made in Selenium always contain wait calls like implicit, explicit and fluent, or could it be that waits are not needed?
0
votes
1answer
156 views

New pc setup and keep getting WebDriverException: unknown error: Failed to create Chrome process

Any new leads on this issue? I recently switched PC and now facing the same problem so many users faced. It was usually solved with downloading the latest chromedriver.exe or by moving the chrome.exe ...
0
votes
1answer
30 views

How to send POST api request with the extracted details from an element using selenium+java

Use case is as below. There is a modal in a website and it contains User ID, Name and email. I want to capture those details using selenium+java and send a POST api request with the above extracted ...
0
votes
2answers
63 views

How to run java+selenium method continuously

Simply, There is a functionality like in sometimes one of modal pops up and there is a button on it. if the modal pops up user need to click on that button. this is continuous process and need to ...
0
votes
1answer
72 views

Jmeter + Java: Error generating dashboard report in dynamic folder

I'm trying to execute performance with Jmeter from Java. My code is written below. I'm facing an issue generating dashboard report. I want to dashboard report to be written in "Target" ...
-1
votes
2answers
48 views

I wrote automation code to click on a date from a data picker but its not working

Website : https://www.abhibus.com/ I am trying to automate selecting date of journey on the website above. Nothing I have tried is working. Screenshot of the date selector Code I am using ...
1
vote
0answers
25 views

Capture Google Analytics data from Charles Proxy using automation

Currently we are using Charles Proxy to capture Google Analytics data for our web site testing. Each page we navigate will have a POST created and request data as shown in the attached screenshot. We ...
1
vote
2answers
56 views

Parallel selenium UI test failure rate has increase when compared to sequential execution

Recently I have implemented parallel selenium UI test execution by increasing Jenkins node count and creating multiple Jenkins jobs with different regression.xml files pointing to them. In a nutshell ...
0
votes
1answer
57 views

Jmeter: How to generate HTML Dashboard in Java

I am trying to execute Jmeter with Java so as to integrate Performance/Load Testing with Jmeter within our Test Automation Framework. I did some research and found (successfully able to execute as ...
1
vote
3answers
257 views

Selenium - Click on button in the last row of the table

I have the below script where I have taken the list of WebElement of the number of rows and subtracted with and then click on the Add button. But the problem over here is - script clicking on the Add ...
2
votes
2answers
835 views

The plugin specification 'com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:' has a problem:

I am getting this error while trying to generate the extent report for cucumber-java and Junit. I am using cucumber version 6.9.1 and grasshopper adapter6. This is my pom.xml file. <!-- ...
2
votes
2answers
145 views

After Load More is clicked once i get the issue waiting for element to no longer be visible:

I have a Search Screen where after I enter the search criteria and search, a Load More button will display if there are more than 30 records. The problem here is it clicks the Load More button for the ...
3
votes
1answer
94 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, ...
1
vote
1answer
36 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 ...
1
vote
1answer
37 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 ...
1
vote
1answer
37 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 ...
0
votes
1answer
62 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?
1
vote
0answers
50 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 ...
2
votes
1answer
46 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, ...
2
votes
1answer
1k 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
37 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
30 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
22 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 ...
0
votes
1answer
77 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 ...
1
vote
1answer
68 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
26 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
49 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:...
1
vote
1answer
37 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 ...
2
votes
4answers
331 views

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

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
1answer
222 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
37 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
62 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 ...

1
2 3 4 5
27