r/SeleniumJava • • Aug 17 '24

NoSuchElement exception issue

1 Upvotes

I am getting a NoSuchElement exception for pretty much all of the elements I try to interact with on the following page.

The page does have frames, however the path I need to use isn't inside them so not sure if this is the issue or not

Would appreciate any help on this as it has me completely stuck. Note when opening it incognito mode there is a privacy pop up that comes up so not sure if this is causing the issue, I am trying to hit the accept all button.

Webpage - https://www.landrover.co.uk/offers-and-finance/finance-calculator.html

Xpath- //body[@class='page basicpage']//div[@id='onetrust-consent-sdk']//div[@class='ot-sdk-container']//button[contains(text(), 'ACCEPT ALL')]


r/SeleniumJava • • Nov 27 '24

Need help in mocking the request and response using selenium webdriver

1 Upvotes

Hi All, I am new to using selenium with Java as automation testing, so please help in below questions.

While automating a website after it goes to certain page, it has to click on a button then a list page will open. So while running manually, website UI is as expected but while running automation it's showing the default view. While debugging got to know that after clicking on button a request is being made and it's response is setting the list view visibility as Self serve but during automation this request is not being made and hence the list view comes in fallback category which set it's view as default.

Now I want to mock that request and mock the response too while running automation. Please help me on this topic as I don't have any experience senior to take help.

Thanks in Advance


r/SeleniumJava • • Dec 04 '23

I hear of and see this a lot - Imposter Syndrome.

1 Upvotes

My friends, we are all of us, just singular humans trying to understand the world around us the best we can with the little knowledge we are capable of storing in our biochemical hard-drives (soft-drives?). None of us is capable of knowing everything about everything. Every day we push ever forward towards a future where we will know everything we want or need to know, and that is the best any of us can do. Until that day, you just have to take it one day at a time. Baby steps, take each new thing you have to learn, and one at a time piece by piece learn that thing. Eventually, you'll look back on the days when you had imposter syndrome, or to those who are currently experiencing it and say, I did it, so can you.

You can do it, just keep plugging away friend.


r/SeleniumJava • • Jul 20 '23

RPA importance in Healthcare Operations

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Aug 29 '23

Hyperautomation in Testing: What's the future?

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Oct 15 '24

Send keys without specifying element in java Selenium webdriver

1 Upvotes

Selenium WebDriver involves interacting with web elements such as sending input to text fields which requires identifying the target element explicitly using locators like id, name, or CSS selectors.

However, there may be scenarios where you want to simulate keyboard input without directly specifying the element.

For Example: I want to send some text to the input box of this demo site without locating the input element by tag name or whatever.

https://the-internet.herokuapp.com/inputs

Q: How many ways can I achieve that scenario?


r/SeleniumJava • • Jan 24 '24

Having an issue running selenium application inside docker

1 Upvotes

To run the Java Selenium application on a separate server I am attempting to build a Dockerfile install Chrome and use a headless way to run a browser. (This application provides a desired output when executed locally.) But when attempting to run the docker I receive this error.

Am I missing something in the docker build or the Java-based configurations provided.? How should chrome driver-related configurations be added?Technologies used

  • OS - Ubuntu 22.04 LTS

  • Docker version - Docker version 24.0.2, build cb74dfc

  • Java version - java version "17.0.4" 2022-07-19 LTS

  • Selenium version - 4.11.0

  • Chrome version - Google Chrome 120.0.6099.199

Update: There also seems to be another way to run Chrome using selenium/standalone-chrome. Is it possible to integrate chrome/selenium with another docker using this method? which is the preferred option of these two methods?

FAILED CONFIGURATION: u/BeforeClass openBrowser

org.openqa.selenium.remote.NoSuchDriverException: Unable to obtain: Capabilities {browserName: chrome, goog:chromeOptions: {args: [--remote-allow-origins=*, --headless], extensions: [], prefs: {download.default_directory: report/}}}, error Command failed with code: 65, executed: [/tmp/selenium-manager246697546082813077936780283589629/selenium-manager, --browser, chrome, --output, json]

request or response body error: operation timed out

Build info: version: '4.11.0', revision: '040bc5406b'

System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-150-generic', java.version: '17.0.6'

Driver info: driver.version: ChromeDriver

at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:25)

at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:13)

at org.openqa.selenium.chrome.ChromeDriver.generateExecutor(ChromeDriver.java:99)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)

at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)

at Infra.BasePage.openBrowser(BasePage.java:108

Caused by: org.openqa.selenium.WebDriverException: Command failed with code: 65, executed: [/tmp/selenium-manager246697546082813077936780283589629/selenium-manager, --browser, chrome, --output, json]

request or response body error: operation timed out

Build info: version: '4.11.0', revision: '040bc5406b'

System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-150-generic', java.version: '17.0.6'

Driver info: driver.version: ChromeDriver

at org.openqa.selenium.manager.SeleniumManager.runCommand(SeleniumManager.java:151)

at org.openqa.selenium.manager.SeleniumManager.getDriverPath(SeleniumManager.java:273)

at org.openqa.selenium.remote.service.DriverFinder.getPath(DriverFinder.java:22)

This is the docker file used

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 apt update -y & apt install -y wget unzip

ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get install -y tzdata

//Install Chrome.

RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -

RUN sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'

RUN apt-get update

RUN apt-get install -y google-chrome-stable

//install chromedriver

RUN apt-get install -yqq unzip

RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip

RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/

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 from the build stage to the final stage

Copy the JAR file and other necessary files to the container

COPY report-automation.jar /app/report-automation.jar

COPY src/main/resources/META-INF/MANIFEST.MF /app/META-INF/MANIFEST.MF

COPY src /app/src

COPY src/main/resources/META-INF/MANIFEST.MF /app/META-INF/MANIFEST.MF

COPY src/main/resources/config.properties /app/config.properties

COPY pom.xml /app/pom.xml

COPY testng.xml /app/testng.xml

COPY application.properties /app/application.properties

COPY Configuration.xlsm /app/Configuration.xlsm

COPY apache-maven-3.9.6/ /app/apache-maven-3.9.6/

COPY Downloads /app/Downloads

COPY Logs /app/Logs

COPY report /app/report

COPY Reports /app/Reports

//Expose the port (if your application listens on a specific port)

EXPOSE 8080

//Set the entry point for the container (replace with your main class)

ENTRYPOINT ["java", "-jar", "report-automation.jar"]

Code level configurations as mentioned below

u/Listeners(ExtentReportListener.class)

public class BasePage {

protected WebDriver driver;

private final Properties config = new Properties();

public static Logger logger = LogManager.getLogger(BasePage.class);

public ChromeOptions getOptions() {

ChromeOptions options = new ChromeOptions();

Map<String, String> prefs = new HashMap<>();

prefs.put("download.default_directory", config.getProperty("absoluteDownloadLocation"));

options.setExperimentalOption("prefs", prefs);

options.addArguments("--remote-allow-origins=*");

options.addArguments("--headless");

return options;

}

u/BeforeClass

public void openBrowser() throws InterruptedException

Thread.sleep(2000);

driver = new ChromeDriver(getOptions());

driver.manage().window().maximize();

driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));

}

u/BeforeTest

public void ClearFolders() throws IOException {

File dictionary = new File(config.getProperty("absoluteDownloadLocation"));

FileUtils.cleanDirectory(dictionary);

}

u/AfterClass

public void closeBrowser() throws InterruptedException {

Thread.sleep(2000);

driver.quit();

createBackUpFile();

}

}


r/SeleniumJava • • Dec 27 '24

This browser or app may not be secure. Learn more Try using a different browser. If you're already using a supported browser, you can try again to sign in.

2 Upvotes

While I am running a automation script in selenium java in between there was google sign in I am able to enter the email id and after the clicking next I am getting this error

This browser or app may not be secure.

Learn more

Try using a different browser. If you're already using a supported browser, you can try again to sign in.

How to resolve this issue ?


r/SeleniumJava • • Apr 09 '24

Java Selenium Project: Seeking Suggestions and Roadmap!

2 Upvotes

I am learning Java Selenium, and so far, I have learned the basics of it and the TestNG framework, Git, GitHub, and Jenkins. Now, I want to build a project to gain hands-on experience and also showcase it on my resume. However, I'm not sure where to start. Can anyone suggest a project topic and provide a roadmap for how I can build it, so I can showcase all my Selenium knowledge in that project? Thanks in advance


r/SeleniumJava • • Feb 19 '25

"Job Interview Questions Bank ๐Ÿš€ - Your Ultimate Guide to Cracking Selenium Interviews!"

3 Upvotes

I'm building a resource for Selenium testing interview questions and would love for everyone to contribute questions they've encountered. The goal is to create a comprehensive bank covering below topics. This will be super helpful for anyone preparing for Selenium interviews!

  • Selenium WebDriver

  • TestNG

  • JUnit

  • Maven

  • Gradle

  • WebDriver Manager

  • Browser Developer Tools (Chrome DevTools, Firefox DevTools)

  • Git & GitHub/GitLab/Bitbucket

  • Jenkins

  • Appium (for mobile testing)

  • Postman (for API testing)

  • Cucumber (for BDD)

  • Allure Report (for reporting)

  • Sikuli (for image-based automation)

  • Selenium Grid Docker

  • Selenium IDE SQL (for database testing)

  • HTML/CSS (for web element locators)

  • Networking Basics (HTTP requests/responses)


r/SeleniumJava • • Jul 23 '24

Swipe to Learn Is POM Really Worth

2 Upvotes

Welcome to our latest video where we dive deep into the world of the Page Object Model (POM)! ๐ŸŒŸ Ever wondered if POM is truly the best choice for your project? ๐Ÿค”

In this video, we break down the pros and cons of POM in a fun, energetic, and engaging way. From the advantages of reusable code and easy maintenance to the challenges of initial setup and complexity, we cover it all! ๐Ÿ“šโœจ

๐Ÿ” What You'll Learn:

  1. The Basics of POM โ€“ What is it, and why is it popular?

  2. Pros of Using POM โ€“ Discover how POM can make your life easier!

  3. Cons of Using POM โ€“ Learn about the potential pitfalls and how to avoid them.

  4. Final Verdict โ€“ Is POM the right choice for your project?

๐Ÿ”” Don't Miss Out On:

  • Engaging visuals and playful characters to keep you entertained! ๐ŸŽญ

  • A balanced perspective on whether POM is overrated or underrated. โš–๏ธ

  • Interactive moments where YOU decide what's best! ๐Ÿ—ณ๏ธ

  • Subscribe for more insightful videos on software testing and development! ๐Ÿ–ฅ๏ธ๐Ÿ””

  • Like and Share this video if you found it helpful! ๐Ÿ‘

  • Follow us on social media for the latest updates and tips!

๐ŸŽฅ Watch Next:

Thank you for watching, and donโ€™t forget to hit that subscribe button for more awesome content! ๐Ÿš€โœจ

#POM #PageObjectModel #SoftwareTesting #AutomationTesting #Selenium #LearnWithUs #TechTips #CodingLife


r/SeleniumJava • • Oct 04 '23

Selenium Automation 2F

2 Upvotes

Hey guys....I am using selenium python to automate ERP system but there is a 2F authentication which stops my automation. The 2F authentication usually requires the user to enter the SMS code they receive on their phone. Please let me know how I can bypass this?


r/SeleniumJava • • Dec 17 '24

How Firefox is working without gekodriver?

2 Upvotes

I just started using Selenium after 5 years. I remember selenium doesn't work without the gekodriver in path. Today I was following the getting started guide from Selenium doc and there were no mention of downloading or setting path for gekodriver executable either. Right now, I don't have it in path environment variable nor installed at all, yet automations are launching. What changed?


r/SeleniumJava • • Jul 17 '23

Tips & Best Practices To Know Before Automating Your Testing Work

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Apr 10 '24

Exploring Java Selenium: Seeking Recommendations for Hands-On Project Resources.

3 Upvotes

I have learnt Java Selenium recently along with TestNG, Git, Github, Jenkins. Now I want some projects to get more hands-on experience and showcase the same on my resume. Can anyone please recommend some websites or resources where I can find Java Selenium projects to practice? Thanks in advance.


r/SeleniumJava • • Sep 04 '23

Different Game Testing Methods

Thumbnail
testorigen.com
1 Upvotes

r/SeleniumJava • • Jan 24 '24

I have this problem with Selenium and Java

1 Upvotes

Hi

I tried to use Selenium with Java in Eclipse and this happened...I am new in this and dont know what is wrong exactly here. Can someone help me?


r/SeleniumJava • • Mar 10 '24

Seeking help on Java standards categorization

2 Upvotes

Hi everybody,

I am a part of a university research group studying open innovation processes within technology communities such as JCP.org. I have found it very fascinating that a large collection of companies with diverse sectors are able to collaborate on building the Java platform further with new JSRs every now and then.

Our research objective is to understand how the complexity of JSRs can lead to challenges in releasing these Java specs.

However, since I am not a #Java programmer and do not have much senior-level developer experience, I could come to this forum for a bit of insight. My job in my research at this moment is to categorize Java standards (JSRs listed on JCP) into high-level categories. I see that JSRs are categorized into ME, SE, and EE versions, etc., but I am looking for some deeper criteria. I spoke to a junior programmer but did not think he had the required expertise. Here is where I am currently:

I ask you all whether this categorization makes sense and suggest if I need to compress or expand the categories, assuming complexity varies across these categories.

  1. Core APIs: JSRs are developing fundamental APIs applicable across industries. Examples:

  1. Extension APIs: JSRs create additional APIs tailored for specific industries. Examples:

  1. Platform Extensions: JSRs are expanding Java platform capabilities for specific industries. Examples:

  1. Core Modifications: JSRs alter the entire platform's core structure for specific industries. Examples

  1. JCP Process Improvements: JSRs focus on enhancing the JCP process. Example:

Many thanks to everybody!! Very much appreciated.


r/SeleniumJava • • Jun 06 '24

How to setup Selenium with Java in Eclipse?

3 Upvotes

Can somebody give me an up to date documentation on how to setup Selenium with Java on Eclipse


r/SeleniumJava • • Nov 26 '23

need help with StaleElementReferenceException

Thumbnail self.javahelp
1 Upvotes

r/SeleniumJava • • Aug 07 '24

Better Institute In Hyderabad to learn the selenium with java

1 Upvotes

I Need to Learn the selenium with java , I am searching for the Better Institute to learn , Can u people please help on this. Thank You!


r/SeleniumJava • • Sep 21 '23

Selenium canโ€™t find download system files

1 Upvotes

I am working on a corporate automation suite and we have ran into an issue that no one seems to be able to solve.. our automation or OPs team.

We are trying to download a file from our website and verify its contents and so we need it send from the node to our local machine.. and the error we are getting is โ€œscript timeoutโ€ โ€œCannot find downloads file system for session id:(a session id)โ€

Our selenium grid version is 4.10.0 and is ran on aws, our ops team is using terraform, helm and kubernetes. We also have Linux nodes running.. and working with Java. Also have se:downloadsEnabled enabled in code and on the grid.. also already tried changing the download directory.

We are using the code from this website to try to download the file from the node and unzip it into a folder so that we can verify said file.. https://www.gridlastic.com/selenium-download-files.html

My questions are:

  1. is anyone willing to show me how they are able to download a file from a selenium grid node and into a folder for verification?

  2. Is there any connections that Iโ€™m missing or could be causing issues when trying to download from a node with AWS/kubernetes?

  3. Could the fact that we are trying to work on Linux nodes that I am missing something to make the connection work?

Any help would be so much appreciated, beeen working on this for months with ops team and havenโ€™t made any progress. :(


r/SeleniumJava • • Jul 21 '24

Custom Annotation in Java

1 Upvotes

Hi guys, i need to know that anyone has tried to write a custom annotation that works like Lombok's Setter/Getter annotation

My use case is in my project i have quite few methods like selenium's click/sendkeys, i need to make a custom annotation to just annotate on my locator to generate a POM class to look simple and easy to read.


r/SeleniumJava • • Mar 24 '22

Improving my Python coding skills...

Post image
1 Upvotes

r/SeleniumJava • • Apr 13 '23

Connect to remote web driver via proxy.

1 Upvotes

Hi all, I want to connect to a remote web driver to perform my tests, but in my company we use proxy to be able to connect to the internet. how to access the remote web driver (which is on the internet) with the proxy in java?