r/SeleniumJava • • May 14 '25

QA Automation testing

2 Upvotes

Hello everyone,

I'm looking for help with writing automation tests using Selenium. I have a few smaller tasks involving creating tests for a website. If anyone can assist, I'd really appreciate it. Thank you in advance!


r/SeleniumJava • • Aug 23 '24

Maven repository

0 Upvotes

Hi all,

I am conducting research on #Java standardization efforts within the Java Community Process (JCP) and am exploring ways to assess the success and significance of Java standards (JSRs). I came across the “Maven Central Repository,” a repository for Java libraries. By searching for JSR numbers on this website, I found that some JSRs are associated with public packages developed and shared by experts. These packages often mention the JSR number in their titles or descriptions, which shows that the packages are related to the standards. You can also see how many projects have used those packages, which I think is a good measure of industry experts' standard adoption. Is this a good and comprehensive measure of JSR success, or are the standards on Maven too specific to represent the entire Java standard portfolio accurately?

If you know of any better ways to measure the success of Java standards, I would greatly appreciate your insights.

Thanks.


r/SeleniumJava • • Sep 12 '23

Optimizing tests in Appium

Thumbnail
testorigen.com
0 Upvotes

r/SeleniumJava • • Aug 12 '24

Throwing Nosuchelement exception. Even though the try and catch are written. Tried GPT too, not working

Post image
1 Upvotes

r/SeleniumJava • • Aug 02 '24

How to create docker file with Chrome browser and chrome driver dependencies for a Java based Selenium application

2 Upvotes

This is related to a maven 3.9.6-based and java 17-based selenium automation project used to log and download files from a remote site, it works fine as a nonotorized application.

This application uses the Chrome browser in headless mode. Currently, the Chrome drivers and relevant Maven versions are bundled with it in the application. The Chrome drivers have to match the Chrome browser for the Selenium operations to work without error. The Chrome browser version in the current server is 123.0.6312.86 and the drivers in drivers/chromedriver-linux64 are used. The Chrome drivers need to be updated if the Chrome browser is updated on the server. I have placed the report-automation.jar at the root level of the application during the build.

Currently, the Chrome browser should be installed on a server and is not bundled in the application in any way. The related Chrome drivers are only bundled in the application. how can this application be dockerized? should the Chrome browser and Chrome driver installation be handled in the docker file?

Given below is a sample docker file I created for this scenario. But the Chrome browser and Chrome driver-related sections need to be updated Could the docker file be optimized further to support containerization optimally?

Furthermore, the outcome of this application is to download a CSV report Downloaded-Report folder in the application. How can this operation be handled if the application is dockerized?

OS Version/build - Ubuntu 18.04 LTS
Docker Version - 24.0.2, build cb74dfc
Maven Version  - 3.9.6
Java Version   - 17.04
Chrome browser version - 123.0.6312.86

The currently used docker file is given below:

# Use the official OpenJDK 17 image as a base image
FROM maven:3.9.6-eclipse-temurin-17-alpine AS builder

# Set the working directory inside the container
WORKDIR /app
RUN chmod -R 777 /app

# Install tools.
RUN apk update && apk add --no-cache wget unzip

#######################
# Install Chrome.
# Adding Google Chrome repository
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community google-chrome-stable

#######################
# Download the Chrome Driver
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip \
    && unzip /tmp/chromedriver.zip -d /usr/local/bin/ \
    && rm /tmp/chromedriver.zip
ENV PATH="/usr/local/bin:${PATH}"
#######################

# Copy the entire project (assuming Dockerfile is in the project root)
COPY . .

# Build the application using Maven
RUN mvn package -DskipTests

# Use the official OpenJDK 17 image as the final image
FROM eclipse-temurin:17.0.6_10-jdk@sha256:13817c2faa739c0351f97efabed0582a26e9e6745a6fb9c47d17f4365e56327d

# Set the working directory inside the container
WORKDIR /app

# Copy the JAR file and other necessary files to the container
COPY --from=builder /app/report-automation.jar /app/report-automation.jar
COPY --from=builder /app/src/main/resources/META-INF/MANIFEST.MF /app/META-INF/MANIFEST.MF
COPY --from=builder /app/src/main/resources/config.properties /app/config.properties
COPY --from=builder /app/pom.xml /app/pom.xml
COPY --from=builder /app/testng.xml /app/testng.xml
COPY --from=builder /app/application.properties /app/application.properties
COPY --from=builder /app/Configuration.xlsm /app/Configuration.xlsm
COPY --from=builder /app/apache-maven-3.9.6/ /app/apache-maven-3.9.6/
COPY --from=builder /app/Downloads /app/Downloads
COPY --from=builder /app/Downloaded-Report /app/Downloaded-Report
COPY --from=builder /app/Logs /app/Logs
COPY --from=builder /app/Reports /app/Reports
COPY --from=builder /app/drivers /app/drivers

# Expose the port (if your application listens on a specific port)
EXPOSE 8080

# Set the entry point for the container
ENTRYPOINT ["java", "-Xmx512m", "-Xms256m", "-jar", "report-automation.jar"]
# Use the official OpenJDK 17 image as a base image
FROM maven:3.9.6-eclipse-temurin-17-alpine AS builder

# Set the working directory inside the container
WORKDIR /app
RUN chmod -R 777 /app

# Install tools.
RUN apk update && apk add --no-cache wget unzip

#######################
# Install Chrome.
# Adding Google Chrome repository
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community google-chrome-stable

#######################
# Download the Chrome Driver
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/$(wget -qO- https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip \
    && unzip /tmp/chromedriver.zip -d /usr/local/bin/ \
    && rm /tmp/chromedriver.zip
ENV PATH="/usr/local/bin:${PATH}"
#######################

# Copy the entire project (assuming Dockerfile is in the project root)
COPY . .

# Build the application using Maven
RUN mvn package -DskipTests

# Use the official OpenJDK 17 image as the final image
FROM eclipse-temurin:17.0.6_10-jdk@sha256:13817c2faa739c0351f97efabed0582a26e9e6745a6fb9c47d17f4365e56327d

# Set the working directory inside the container
WORKDIR /app

# Copy the JAR file and other necessary files to the container
COPY --from=builder /app/report-automation.jar /app/report-automation.jar
COPY --from=builder /app/src/main/resources/META-INF/MANIFEST.MF /app/META-INF/MANIFEST.MF
COPY --from=builder /app/src/main/resources/config.properties /app/config.properties
COPY --from=builder /app/pom.xml /app/pom.xml
COPY --from=builder /app/testng.xml /app/testng.xml
COPY --from=builder /app/application.properties /app/application.properties
COPY --from=builder /app/Configuration.xlsm /app/Configuration.xlsm
COPY --from=builder /app/apache-maven-3.9.6/ /app/apache-maven-3.9.6/
COPY --from=builder /app/Downloads /app/Downloads
COPY --from=builder /app/Downloaded-Report /app/Downloaded-Report
COPY --from=builder /app/Logs /app/Logs
COPY --from=builder /app/Reports /app/Reports
COPY --from=builder /app/drivers /app/drivers

# Expose the port (if your application listens on a specific port)
EXPOSE 8080

# Set the entry point for the container
ENTRYPOINT ["java", "-Xmx512m", "-Xms256m", "-jar", "report-automation.jar"]

The application's hierarchical structure is mentioned below.

/workspace/report-automation$ tree -L 2
.
├── apache-maven-3.9.6 //Bundled maven
│   
├── application.properties
├
├── Configuration.xlsm
├── Dockerfile
├── Downloaded-Report
│   └── SalesReport.csv  //Downloaded report
├── Downloads
├── drivers
│   ├── chromedriver-linux64 //Bundled chrome drivers
│   └── chromedriver-mac-arm64
├── Logs
│   └── TestLogs.log
├── out
│   └── artifacts
├── pom.xml
├── README.md
├── report-automation.jar  // Applications jar file
├── Reports
│   └── ExtentReport.html
├── src
│   └── main
├── target
│   ├── classes
│   ├── generated-sources
│   ├── maven-archiver
│   ├── maven-status
│   ├── surefire-reports
│   
└── testng.xml
/workspace/report-automation$ tree -L 2
.
├── apache-maven-3.9.6 //Bundled maven
│   
├── application.properties
├
├── Configuration.xlsm
├── Dockerfile
├── Downloaded-Report
│   └── SalesReport.csv  //Downloaded report
├── Downloads
├── drivers
│   ├── chromedriver-linux64 //Bundled chrome drivers
│   └── chromedriver-mac-arm64
├── Logs
│   └── TestLogs.log
├── out
│   └── artifacts
├── pom.xml
├── README.md
├── report-automation.jar  // Applications jar file
├── Reports
│   └── ExtentReport.html
├── src
│   └── main
├── target
│   ├── classes
│   ├── generated-sources
│   ├── maven-archiver
│   ├── maven-status
│   ├── surefire-reports
│   
└── testng.xml

This error is also thrown when the docker file is being built.

randunu@randunu:/rezsystem/workspace/report-automation$ sudo docker build -t report-automation .

[+] Building 358.0s (9/27)                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                               0.0s
 => => transferring dockerfile: 2.48kB                                                                                                                             0.0s
 => [internal] load .dockerignore                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/eclipse-temurin:17.0.6_10-jdk@sha256:13817c2faa739c0351f97efabed0582a26e9e6745a6fb9c47d17f4365e56327d           0.0s
 => [internal] load metadata for docker.io/library/maven:3.9.6-eclipse-temurin-17                                                                                  3.0s
 => [internal] load build context                                                                                                                                  0.1s
 => => transferring context: 51.39kB                                                                                                                               0.0s
 => CANCELED [builder 1/4] FROM docker.io/library/maven:3.9.6-eclipse-temurin-17@sha256:29a1658b1f3078e07c2b17f7b519b45eb47f65d9628e887eac45a8c5c8f939d4         354.9s
 => => resolve docker.io/library/maven:3.9.6-eclipse-temurin-17@sha256:29a1658b1f3078e07c2b17f7b519b45eb47f65d9628e887eac45a8c5c8f939d4                            0.0s
 => => sha256:408d89a73e0dc1b14cfbc003f5729720855da4003a266ebf841cf2c298a8d144 2.41kB / 2.41kB                                                                     0.0s
 => => sha256:5e5d1bccc5440d3a24f4a620704b9e687b4163c6c872fcc8e812e200c9bbac58 17.46MB / 17.46MB                                                                 120.0s
 => => sha256:29a1658b1f3078e07c2b17f7b519b45eb47f65d9628e887eac45a8c5c8f939d4 1.21kB / 1.21kB                                                                     0.0s
 => => sha256:b86805e902bf7f1eb3cd9d7f99f0cb391aacca9fe5653ba2c8279d2f0a4e2c23 7.91kB / 7.91kB                                                                     0.0s
 => => sha256:4a023cab5400feb5c1ab725beb8345ddb0e3200314004b56677a5eee2e8c86cf 30.44MB / 30.44MB                                                                 236.3s
 => => sha256:d59fd278c1b4ffe1727be6ccba42125e8f4db57e660e795cce19889d2c776457 61.87MB / 145.10MB                                                                354.9s
 => => sha256:c97285723537ab7921fca4d081c256e501adfdaa8992d04637992075f4cea392 173B / 173B                                                                       122.1s
 => => sha256:a3ba11f7aaaedad962216812fe84aee9061aeabac6932f0274a1d204eb96e8e8 734B / 734B                                                                       122.5s
 => => sha256:67f99c2668af1d0eced6d61dad057d7beffe543a8e8370d5c0d3fe8682e059a3 19.00MB / 19.00MB                                                                 275.5s
 => => sha256:45f480637770dbb740623c0c7f827d44bbacc9204faf3d07b4135d54a2bee043 9.48MB / 9.48MB                                                                   293.0s
 => => extracting sha256:4a023cab5400feb5c1ab725beb8345ddb0e3200314004b56677a5eee2e8c86cf                                                                          0.5s
 => => extracting sha256:5e5d1bccc5440d3a24f4a620704b9e687b4163c6c872fcc8e812e200c9bbac58                                                                          0.4s
 => => sha256:58c3491a14ebc973960cbda9f2eea22537785a3cb07e81487bd1115bad4a8278 852B / 852B                                                                       276.5s
 => => sha256:4712dfa85971124b8c3507fbba4c02441e5754f1517162926e600afd3fc5404b 358B / 358B                                                                       276.9s
 => => sha256:fc06d68d71ba375a9ceed165c0c04b09b1a8cc193146888663b005660fc25013 156B / 156B                                                                       277.4s
 => [stage-1  1/18] FROM docker.io/library/eclipse-temurin:17.0.6_10-jdk@sha256:13817c2faa739c0351f97efabed0582a26e9e6745a6fb9c47d17f4365e56327d                   0.0s
 => CACHED [stage-1  2/18] WORKDIR /app                                                                                                                            0.0s
 => ERROR [stage-1  3/18] RUN apt-get update &&     apt-get install -y wget unzip gnupg &&     wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.p  354.9s
------                                                                                                                                                                  
 > [stage-1  3/18] RUN apt-get update &&     apt-get install -y wget unzip gnupg &&     wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' &&     apt-get update &&     apt-get install -y google-chrome-stable &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*:                                                                                     
#0 1.293 Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]                                                                                                
#0 3.757 Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]                                                                                      
#0 6.756 Get:3 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [44.7 kB]
#0 7.154 Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]
#0 7.157 Get:5 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2,118 kB]
#0 10.38 Get:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
#0 13.30 Get:7 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1,792 kB]
#0 25.08 Get:8 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1,131 kB]
#0 34.61 Get:9 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [2,787 kB]
#0 53.25 Get:10 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]
#0 60.66 Get:11 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]
#0 65.24 Get:12 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]
#0 300.8 Get:13 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [51.8 kB]
#0 301.5 Get:14 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [2,396 kB]
#0 323.5 Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1,421 kB]
#0 332.4 Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [2,884 kB]
#0 352.6 Get:17 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [33.7 kB]
#0 353.4 Get:18 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [81.0 kB]
#0 354.0 Fetched 33.3 MB in 5min 54s (94.2 kB/s)
#0 354.0 Reading package lists...
#0 354.8 E: Problem executing scripts APT::Update::Post-Invoke 'rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true'
#0 354.8 E: Sub-process returned an error code
------
ERROR: failed to solve: executor failed running [/bin/sh -c apt-get update &&     apt-get install -y wget unzip gnupg &&     wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - &&     sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' &&     apt-get update &&     apt-get install -y google-chrome-stable &&     apt-get clean &&     rm -rf /var/lib/apt/lists/*]: exit code: 100

any suggestions on how this issue may be handled?


r/SeleniumJava • • Jul 22 '24

Self healing selenium scripts backed by AI

3 Upvotes

r/SeleniumJava • • Oct 18 '23

Basic HTTP Authentication...

2 Upvotes

Has anyone found a workaround for this problem?


r/SeleniumJava • • Jan 23 '24

How to setup Selenium with Java in Visual studio?

1 Upvotes

Hi How to setup Selenium with Java in Visual studio?


r/SeleniumJava • • Apr 29 '24

DataProvider

2 Upvotes

I'm considering building a data provider for TestNG's @Test, with one set of data from Excel and another from a method returning data as a string array. Is there a way to merge them or a better approach to handle this scenario?


r/SeleniumJava • • Jul 13 '23

Advantageous Landscape of Integrating IoT and ERP

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Jul 09 '24

AWS for executing automated tests with selenium + java doesn't fill fileds with sendKeys command

1 Upvotes

0

I'm using AWS to execute automated regression tests with Selenium and Java. I've encountered an issue where, on some forms, the fields are not being populated with text after the sendKeys() command. This issue does not occur when I run the tests on my local machine. Has anyone experienced this before, and how did you solve it?

I also try to to complete fields with JS executor:

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("arguments[0].value='4646464646464644';", adyenCardNumber);

This populates the fields, but the form is not validated after clicking submit button.


r/SeleniumJava • • Dec 05 '24

what is the best way to video screen record selenium tests and attach to Allure report

2 Upvotes

My tests are running in Jenkins lInux machine.
when executing the tests , i want following things to happen

  1. Screen record during test execution

  2. Save the video

  3. Attach the video with allure report

  4. Delete the video after 5 days

any libraries you guys suggest for the same ?


r/SeleniumJava • • Jul 28 '24

JBehave Web Selenium version?

Thumbnail self.softwaretesting
1 Upvotes

r/SeleniumJava • • Jun 19 '24

Okta Authentication in Test Automation Using Selenium Java

4 Upvotes

Hey all, I've been dealing with this same login issue for year and I HATE Okta so much because it always ends up being the one thing that makes it so difficult to fully automate our testing. We were doing just fine given that we were able to use the security question method when logging in but our cyber security department decided to remove that option altogether. Has anyone been able to automate logging into Okta using the Okta verify app or sms options? How did you integrate into your test automation? Examples? For context, I built a Maven framework using Selenium WebDriver and written in Java. It uses Cucumber TestNG.


r/SeleniumJava • • Nov 15 '23

How do I count the number of times a looping Selenium script has been run in the Script itself?

1 Upvotes

As the title says guys...

Im looping my Selenium script 200 times with the cmd "times".

Is there another command I can place at the end of my code that will count and show me live how often the script has looped already?

Thanks for your help!


r/SeleniumJava • • Jul 11 '23

Hacking’s Positive and Negative Side

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Aug 28 '24

Java Selenium Work

4 Upvotes

I have learned Java basics (Variables, Data Types, Conditions, Loop, Oops, Casting, Wrapper, Arrays, Exception Handling, ) and Selenium.

I want to know how we work in real projects or companies as I don't have automation experience. I have 2 years of work experience as a Manual so kindly explain or share the experiences.


r/SeleniumJava • • Jul 25 '23

Breaking Free from Code Constraints with Scriptless Automation Testing

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Oct 16 '24

Ayuda con SELENIUM JAVA

1 Upvotes

Hello, good afternoon/morning. I'm starting with automated testing at my job, and I'm using Java, Selenium, and Chromedriver. I'm having a problem: I want to get the text of a button and validate it in my code. The issue is that the button's identifier isn't the one shown in the Google inspector, and when I use it in my code and run the program, I get an error saying that the button identifier wasn't found. I've gone through every container, every div, but the problem remains. Just a small detail: the button is inside an iframe. When I copy the iframe identifier and use it in my code, there's no error in the console, but the text of the button on the webpage I'm testing doesn't appear, as if it wasn't found.

I hope someone can help me, I'd appreciate it very much. I'll include screenshots.

It is assumed that what is selected in blue is the identifier that shows the error in the eclipse console, the one used in the previous captures is the identifier of an iframe tag


r/SeleniumJava • • Jul 24 '24

No Need for Automation Engineers Anymore? AI Generates and Executes Sele...

Thumbnail
youtube.com
3 Upvotes

r/SeleniumJava • • Aug 02 '23

How to Boost Software Testing Speed

1 Upvotes

Several Methods for Speeding Up Software Testing

  1. Optimizing the Test Suite: One of the most crucial elements in quickening software testing is test suite optimization. Here are some considerations to bear in mind:

  • Pick the most crucial test cases to run first when prioritizing test execution. This ensures that critical functionality is thoroughly tested at an early stage.

  • Parallel evaluation: Reduce the overall execution time by running numerous tests concurrently utilizing parallel testing approaches.

  • Test Selection: Examine the impact and dependencies of code modifications to determine which tests are relevant and execute them only when necessary. This approach saves time by avoiding needless tests.

  1. Test Data Management: A successful test data management strategy can have a significant impact on testing speed. Consider the following methods:

  • To assure the prompt availability of required data sets, automate the development of test data.

  • To boost the process of...... (Read More)


r/SeleniumJava • • Aug 10 '23

Testsigma’s Low-Code API Testing

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Aug 24 '23

Is non-functional testing important?

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Aug 07 '23

Automation testing with ChatGPT

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Oct 12 '23

I need some Load Testing recommendations...

1 Upvotes

We are not a big company but we provide service to very large groups of users in the hundreds of thousands. There is just no budget for load testing at the moment as we're starting from scratch. I can't test for hundreds of thousands of users and I feel like I shouldn't have to test that many users can all access the program at once. How do I realistically design a load test that would provide me with the data to make the statement "our product can handle 100,000 users." without testing 100,000 users all connecting at the same time?

I don't have any data to tell me how many users are actually using the product at any given time - which would help immensely in determining the amount of users needed in testing. I don't believe that we ever actually have hundreds of thousands of users all on at the same time anyway, but that's not really the point, I need to test what I can.

I'm considering using Jmeter (as if I have a choice) and to that end I have set up some simple tests running on my VM. It's become clear one PC will not be able to handle more than 100 users (at least not our PC's). So, I'm left having to rethink much of this and I'm turning to you for suggestions.

How do I approach this?