DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • A Comprehensive Guide to GitHub
  • GitOps: Flux vs Argo CD
  • GitHub Security 101: Best Practices for Securing Your Repository
  • [CSF] Enable Continuous Delivery of Your Resume With GitHub Actions

Trending

  • AI-Based Threat Detection in Cloud Security
  • How Kubernetes Cluster Sizing Affects Performance and Cost Efficiency in Cloud Deployments
  • Mastering Fluent Bit: Installing and Configuring Fluent Bit on Kubernetes (Part 3)
  • The Human Side of Logs: What Unstructured Data Is Trying to Tell You
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. Adding a Selenium-Maven Project From Eclipse to GitHub Repository

Adding a Selenium-Maven Project From Eclipse to GitHub Repository

How to add a Selenium project created in Eclipse using Maven to GitHub public Repository.

By 
Remi Andonissamy user avatar
Remi Andonissamy
·
May. 28, 20 · Tutorial
Likes (4)
Comment
Save
Tweet
Share
6.0K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we will understand how to create a simple Selenium project using Maven in Eclipse and we will see how to push the project to GitHub Repository.

How to Create Selenium Test in Eclipse?

Step 1: File -> New -> Project -> Maven Project

maven project

Step 2: Check “Create a simple project (skip archetype selection) and say “Next”

simple project

Step 3: Name Group Id and Artifact Id as “MySeleniumProject” and say “Finish”. You can name as any name as you wish

configure project

Step 4: Create a new package “mySeleniumPackage” under src/test/java of our Maven project and say “Finish”.

new java package

Step 5: Create a new class “OpenFacebook” under mySeleniumPackage and enable main()

new java class

Step 6: Update the pom.xml file of the Maven project with latest Selenium and TestNG dependencies

code

Step 7: Create a Selenium test to open Facebook home page in Firefox browser by loading the geckodriver.exe and get the title of the webpage

code

Step 8: Create a xml file named “testing.xml” in our Maven project to run the created testcase. Add the below code. Mention the package name and the class name where we have our Selenium test in the format packagename.classname

Please note:- This step is optional and it is required to run the test as batch and if we need to run the test in any continuous integration server like Jenkins

code

Step 9: Run the testing.xml file as TestNG Suite to ensure everything is working fine in our local system

***********************************************************************************************

How to create a public GIT Repository?

Step 1: Open www.github.com

Step 2: Sign Up and register a free account in github.com

Step 3: Login to www.github.com and create a new repository selecting “New” button

repositories

Step 4: Give a name for your repository “SeleniumProject”, select Public and say “Create repository”. Providing “Public” access enables anyone to see your repository. If you want to restrict access to your repository, you can select as “Private”

create new repository

Step 5: This creates a public repository in github.com and it can be accessed using the URL – https://github.com/remijullian/SeleniumProject.git

How to Push Your Selenium Project to GitHub

Step 1: Install GIT locally in system. Go to URL -> https://git-scm.com/download/win and download GIT for Windows based on your operating system whether it is 32 bit or 64 bit.

Step 2: Install GIT in the local system by following the installation steps. This step is important to create a local repository in our system.

Step 3: Go to Eclipse, select your project “MySeleniumProject” -> Right Click -> Team -> Share Project

Step 4: Configure Git repository. This step is to create a local repository of our Selenium project in our system. Check “Use or create repository in parent folder of project” and select “Create Repository” and say “Finish”. This creates a .git file in the physical location of the selenium project. In our case, the local repository is created at “C:\RemiFiles\Backup4\Projects\Selenium\MySeleniumProject.git”

configure git repository

Step 5: Our project in eclipse is connected to local repository. If we want to push the project to remote repository, right click the project -> Team -> Commit

commit

Step 6: Eclipse will open a “Git Staging” window. We will find 3 sections – Unstaged Changes, Staged Changes and Commit Message.

Step 7: Unstaged Changes are the new files that needs to get updated in the shared repository.   If we need to add code to shared repository, we need to move Unstaged Changes to Staged Changes. Once moved, provide a “Commit message” and select “Commit and Push”. Commit message enables others to understand what changes has been made to the existing code in Git Repository

git staging

Step 8: Give the details of the shared repository where we wish to push the Selenium code. Also give the Authentication credentials to connect to shared repository and push the code

destination of git repository

Step 9: Accept the confirmation message on the details of the shared repository where to push the files. Click the “Finish” button

push configuration

Step 10: Confirm the credentials once again to push

confirm credentials

Step 11: Once the project gets pushed successfully to remote repository, we will get a confirmation message as below:

push results

Step 12: Go to remote repository and refresh the page. We can able to see the Selenium project contents got updated there along with the commit message we have issued in eclipse

project in github

Conclusion

This is how we can create a Selenium project in eclipse and update in GIT repository. We can further clone the project if we need a local copy on a different system or pull the project to update the local repository with the recent changes made in the remote repository.

Thanks for reading this article. For any queries please reach out to me.

Repository (version control) Eclipse operating system Git GitHub

Opinions expressed by DZone contributors are their own.

Related

  • A Comprehensive Guide to GitHub
  • GitOps: Flux vs Argo CD
  • GitHub Security 101: Best Practices for Securing Your Repository
  • [CSF] Enable Continuous Delivery of Your Resume With GitHub Actions

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!