This document provides a guide for setting up Selenium, TestNG, and Eclipse IDE for automation testing. It includes instructions on installing Firefox, the Selenium IDE plugin, JDK, Eclipse, and TestNG. It also covers using the DOM Inspector to find element locators like XPath and CSS, and creating a sample Java project in Eclipse with a TestNG class containing test code. The goal is to provide beginners with a step-by-step process for getting started with test automation.
What is TestNG in Selenium? TestNG is a data driven framework that allows to group, prioritise and order your test case in the most convenient manner YOU descire. Let's see more about it.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
YouTube Link: https://youtu.be/0psQYu8fw0I
**Selenium Training: https://www.edureka.co/selenium-certification-training **
This Edureka PPT on 'TestNG Annotations in Selenium' will help you understand various annotations that TestNG support along with examples.
Below topics are covered in this PPT:
Introduction to TestNG
Why use TestNG with Selenium?
Advantages of TestNG over JUnit
TestNG Annotations
Creating a first test case
Selenium playlist: https://goo.gl/NmuzXE
Selenium Blog playlist: http://bit.ly/2B7C3QR
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
What is TestNG in Selenium? TestNG is a data driven framework that allows to group, prioritise and order your test case in the most convenient manner YOU descire. Let's see more about it.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
YouTube Link: https://youtu.be/0psQYu8fw0I
**Selenium Training: https://www.edureka.co/selenium-certification-training **
This Edureka PPT on 'TestNG Annotations in Selenium' will help you understand various annotations that TestNG support along with examples.
Below topics are covered in this PPT:
Introduction to TestNG
Why use TestNG with Selenium?
Advantages of TestNG over JUnit
TestNG Annotations
Creating a first test case
Selenium playlist: https://goo.gl/NmuzXE
Selenium Blog playlist: http://bit.ly/2B7C3QR
Follow us to never miss an update in the future.
YouTube: https://www.youtube.com/user/edurekaIN
Instagram: https://www.instagram.com/edureka_learning/
Facebook: https://www.facebook.com/edurekaIN/
Twitter: https://twitter.com/edurekain
LinkedIn: https://www.linkedin.com/company/edureka
Castbox: https://castbox.fm/networks/505?country=in
This presentation describes the some of the major functionality of JUnit4 and TestNG .Each topic contains example so that a viewer can understand the usage and apply them in their code.
1. Introduction to TestNG Framework.
2. TestNG Advantages.
3. Installation of Eclipse Plugin for TestNG.
4. The First Program using TestNG framework
5. TestNG Test Annotations and their uses
6. Execution of test case with a single class and with multiple class
7. Sequential and Parallel Run of Test Scripts
8. Verification of Test Result
TestNG is a testing framework inspired from JUnit and NUnit, which can be used as a core unit test framework for Java project.
Demo: https://github.com/bethmi/testng-demo
All software operates on data. High quality software needs to be thoroughly tested. This mandates to take the data into account and creates a need for easy and powerful solutions for data driven unit, functional and integration tests. Data driven tests are tests in which the test logic stays the same and the test data changes with each invocation of the test logic.
With TestNG implementing and executing data driven tests is easy as test data can be injected into test methods as method parameters. Unfortunately TestNG doesn't provide any standard for binding test data from external data sources, like XML, or CSV / Excel files, to the test method parameters. It rather leaves it up to each developer to implement her own solution for data binding. To minimize the effort this calls for the provision of a standardized solution.
This presentation shows how easy it is to implement data driven tests with TestNG. It then goes on to introduce the TestNG Data Binding framework. This framework fills the gap and provides a standardized solution for test data binding. It features an open, plug-in based architecture allowing for countless data formats to be bound to test method parameters. Currently it can bind data from CSV, Java .properties, text and XML files.
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
1. About Selenium
2. Brief Introduction Selenium IDE
3. Pro and Cons of Selenium IDE
4. When do you need Selenium IDE
5. What will Selenium IDE help you
6. How to install Selenium IDE
7. How to use Selenium with script and command
8. Using Common Features Of Selenium IDE
9. Selenium IDE Commands
10. Locators
11. How to use Locators in Selenium IDE
This presentation describes the some of the major functionality of JUnit4 and TestNG .Each topic contains example so that a viewer can understand the usage and apply them in their code.
1. Introduction to TestNG Framework.
2. TestNG Advantages.
3. Installation of Eclipse Plugin for TestNG.
4. The First Program using TestNG framework
5. TestNG Test Annotations and their uses
6. Execution of test case with a single class and with multiple class
7. Sequential and Parallel Run of Test Scripts
8. Verification of Test Result
TestNG is a testing framework inspired from JUnit and NUnit, which can be used as a core unit test framework for Java project.
Demo: https://github.com/bethmi/testng-demo
All software operates on data. High quality software needs to be thoroughly tested. This mandates to take the data into account and creates a need for easy and powerful solutions for data driven unit, functional and integration tests. Data driven tests are tests in which the test logic stays the same and the test data changes with each invocation of the test logic.
With TestNG implementing and executing data driven tests is easy as test data can be injected into test methods as method parameters. Unfortunately TestNG doesn't provide any standard for binding test data from external data sources, like XML, or CSV / Excel files, to the test method parameters. It rather leaves it up to each developer to implement her own solution for data binding. To minimize the effort this calls for the provision of a standardized solution.
This presentation shows how easy it is to implement data driven tests with TestNG. It then goes on to introduce the TestNG Data Binding framework. This framework fills the gap and provides a standardized solution for test data binding. It features an open, plug-in based architecture allowing for countless data formats to be bound to test method parameters. Currently it can bind data from CSV, Java .properties, text and XML files.
Beginners - Get Started With Unit Testing in .NETBaskar K
Beginners - Get started with unit testing in .NET. Introduction to unit testing and mocking.. List of unit testing frameworks available in .NET - NUnit, xUnit.net, Visual Studio unit test framework. List of mocking frameworks available in .NET - Moq, Rhino Mocks, FakeItEasy, NSubstitue, JustMock, and TypeMock. Introduction to Visual Studio Unit Testing Framework, NUnit and xUnit.net.
1. About Selenium
2. Brief Introduction Selenium IDE
3. Pro and Cons of Selenium IDE
4. When do you need Selenium IDE
5. What will Selenium IDE help you
6. How to install Selenium IDE
7. How to use Selenium with script and command
8. Using Common Features Of Selenium IDE
9. Selenium IDE Commands
10. Locators
11. How to use Locators in Selenium IDE
Dear readers, these set of interview questions are designed in a way to help in cracking the automation testing with Selenium Webdriver. In this document we will try to cover all those topics which we generally use with Selenium Webdriver, such as Maven, TestNG etc.
We provide Selenium training in Chennai with real time scenarios. We are the best training institute in Chennai providing the real time training in Chennai. Selenium is an open source testing tool .Selenium is an automation testing framework that is used to test web based applications.
We provide Selenium training in Chennai with real time scenarios. We are the best training institute in Chennai providing the real time training in Chennai. Selenium is an open source testing tool .Selenium is an automation testing framework that is used to test web based applications.
Everything you need to know about the Selenium IDE: TutorialpCloudy
Selenium IDE (Integrated Development Environment) is a record and playback automation tool. It allows users to create test scripts through recording and playback the recorded tests, debug and analyze test results. Testers with no programming knowledge can use this tool seamlessly by recording and playing back the repetitive regression tests. Every tool has benefits as well as limitations and people can choose it according to their requirements and how beneficial it is for them. Following is the list of Benefits and Limitations of Selenium IDE.
I. Converting Selenium IDE tests to run in a
programming language and getting them running
II. Writing Selenium Remote Control tests from
scratch
III. Applying best practices such as Page Object
design pattern to create lasting tests
IV. Running tests against a continuous integration
server
We provide best Selenium training in Chennai with real time scenarios. We are the best training institute in Chennai providing the real time training in Chennai
So if you want to learn selenium then you can reach us.We provide best selenium training.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
As part of the DOE Integrated Research Infrastructure (IRI) program, NERSC at Lawrence Berkeley National Lab and ALCF at Argonne National Lab are working closely with General Atomics on accelerating the computing requirements of the DIII-D experiment. As part of the work the team is investigating ways to speedup the time to solution for many different parts of the DIII-D workflow including how they run jobs on HPC systems. One of these routes is looking at Globus Compute as a way to replace the current method for managing tasks and we describe a brief proof of concept showing how Globus Compute could help to schedule jobs and be a tool to connect compute at different facilities.
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Experience our free, in-depth three-part Tendenci Platform Corporate Membership Management workshop series! In Session 1 on May 14th, 2024, we began with an Introduction and Setup, mastering the configuration of your Corporate Membership Module settings to establish membership types, applications, and more. Then, on May 16th, 2024, in Session 2, we focused on binding individual members to a Corporate Membership and Corporate Reps, teaching you how to add individual members and assign Corporate Representatives to manage dues, renewals, and associated members. Finally, on May 28th, 2024, in Session 3, we covered questions and concerns, addressing any queries or issues you may have.
For more Tendenci AMS events, check out www.tendenci.com/events
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Accelerate Enterprise Software Engineering with PlatformlessWSO2
Key takeaways:
Challenges of building platforms and the benefits of platformless.
Key principles of platformless, including API-first, cloud-native middleware, platform engineering, and developer experience.
How Choreo enables the platformless experience.
How key concepts like application architecture, domain-driven design, zero trust, and cell-based architecture are inherently a part of Choreo.
Demo of an end-to-end app built and deployed on Choreo.
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
In software engineering, the right architecture is essential for robust, scalable platforms. Wix has undergone a pivotal shift from event sourcing to a CRUD-based model for its microservices. This talk will chart the course of this pivotal journey.
Event sourcing, which records state changes as immutable events, provided robust auditing and "time travel" debugging for Wix Stores' microservices. Despite its benefits, the complexity it introduced in state management slowed development. Wix responded by adopting a simpler, unified CRUD model. This talk will explore the challenges of event sourcing and the advantages of Wix's new "CRUD on steroids" approach, which streamlines API integration and domain event management while preserving data integrity and system resilience.
Participants will gain valuable insights into Wix's strategies for ensuring atomicity in database updates and event production, as well as caching, materialization, and performance optimization techniques within a distributed system.
Join us to discover how Wix has mastered the art of balancing simplicity and extensibility, and learn how the re-adoption of the modest CRUD has turbocharged their development velocity, resilience, and scalability in a high-growth environment.
Navigating the Metaverse: A Journey into Virtual Evolution"Donna Lenk
Join us for an exploration of the Metaverse's evolution, where innovation meets imagination. Discover new dimensions of virtual events, engage with thought-provoking discussions, and witness the transformative power of digital realms."
Navigating the Metaverse: A Journey into Virtual Evolution"
Selenium with testng and eclipse ide
1. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Selenium Automation set up
with TestNG and Eclipse- A
Beginners Guide
Authors: Eevuri Sri Harsha, Ranjani Sivagnanam
Sri Harsha is working as an Associate Software Engineer (QA) for IBM Policy Atlas
team under ECM. Reach out to her at eeharsha@in.ibm.com
Ranjani, is working as a Staff Software Engineer (QA) for IBM Policy Atlas team
under ECM. Reach out to her at ranjani.sivagnanam@in.ibm.com
Abstract: This article is a guide for the beginners when they use Selenium, Testing
and Eclipse IDE for automation testing
2. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
1. Introduction
Selenium IDE/Web driver has becoming a very popular testing tool as it is an open source. This is a GUI
Automation tool. This is a beginner’s guide to install and use Selenium with Testing and Eclipse IDE. This
gives a step by step installation guide to Kick-start an Automation journey.
This document will describe one of the ways of setting up the environment automating Web
Applications. Described here will be a sample test script, object repository build up using XPath or CSS,
reporting configuration for the test run.
1.1 Install Firefox in Windows:
1. Visit the Firefox download page in any browser (e.g. Microsoft Internet Explorer). The page will
automatically recommend the best version(s) of Firefox for you.
2. Firefox Download Page - Windows-> Download 32-bit-Firefox Setup 3.6.0.exe
3. Click on the green download link to download the Firefox installer. Start the process by clicking
Run.
4. Install Firefox 3.6 by a double click on Firefox icon -> click on next buttons, install button, Launch
Firefox by click on finish button.
5. See the below screens to follow up.
Figure 1
3. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 2
1.2 Install DOM Inspector:
1. Open Firefox 3.6 and go to Tools -> Add ons.
2. In Search tab give DOM Inspector: click on install the latest version.
3. Go to Tools-> Add ons -> Search -> give Inspect this as search term ad click on install the latest
version.
4. See the below screens to follow up.
Figure 3
4. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 4
1.3 Install JDK 1.7:
1. Download Windows JDK 1.7 from
http://www.oracle.com/technetwork/java/javase/downloads/index.html
2. Install JDK 1.7
2. Selenium Introduction :
The Selenium-IDE (Integrated Development Environment) is the tool you use to develop your Selenium
test cases. It’s an easy-to-use Firefox plug-in and is generally the most efficient way to develop test
cases. It also contains a context menu that allows you to first select a UI element from the browser’s
currently displayed page and then select from a list of Selenium commands with parameters pre-defined
according to the context of the selected UI element. This is not only a time-saver, but also an excellent
way of learning Selenium script syntax.
2.1 Install Selenium IDE:
1. Open Firefox 3.6 and goto Tools -> ADD ONS.
2. In Search tab give Selenium IDE : click on install the latest version.
3. After install Selenium IDE -> Go to Tools-> Add Ons-> Extensions sub tab -> Selenium IDE .
4. Click on options in Selenium IDE.
5. Identify below tabs to work on Different platform Environments and to see default settings
7. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
2.2 Selenium Web Driver:
The biggest change in Selenium recently has been the inclusion of the Web Driver API. Driving a browser
natively as a user would either locally or on a remote machine using the Selenium Server it marks a leap
forward in terms of browser automation
Selenium 1.0 + Web Driver = Selenium 2.0
1. Web Driver is designed in a simpler and more concise programming interface along with
addressing some limitations in the Selenium-RC API.
2. It drives the browser much more effectively and over comes the limitations of Selenium 1.x
which affected our functional test coverage, like the file upload or download, pop-ups and
dialogs barrier.
3. To Support Web Driver we need to keep selenium standard 2.33 jar file in Project class path.
Install selenium-server-standalone-2.33.0.jar file to support Selenium Remote Web driver:
1. Download selenium-server-standalone-2.33.0.jar from web.
2. We need to keep selenium-server-standalone-2.33.0.jar in created Selenium Project Class path.
3. This jar file will support handling Remote browsers and web drivers, different browsers.
4. See the below screen for RC components.
Figure 7
2.3 Install DOM Inspector to inspect web elements using Xpath:
8. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
The web contains static and dynamic objects/elements. For static elements Ids are same at any time.
Ex: Button , Text box , Text Area ids .Using Inspect this element we can identify element id xpath.
1. While using Selenium IDE, sometimes the dynamic elements cannot be identified. These have to
be identified at run time.
2. Static elements are like button, text box, text area. For static elements Ids are same at any time.
3. But for Dynamic elements Ids will change at execution time.
4. DOM Inspector is useful to identify dynamic elements with common id at any time.
5. Here Xpath is creating id to identify dynamic element.
6. Example : Identify one checkbox id among multiple check boxes ids.
7. Check box id will change dynamically. That time Xpath using Dom inspector is useful to identify
the Id.
To explain how we use XPATH or CSS, here is an example:
On the home page of Google India search page, we see list of languages which can be used to convert
Google page into particular language.
The example is covering Google English to Google Hindi.
1. Open Firefox.
2. Open www.google.co.in page.
3. Open DOM Inspector from Tools-> Web developer -> DOM inspector -> click on cursor icon of
Dom inspector and click on any web element in Firefox to get id path.
4. See below screen for XPATH. Here its clicking on Hindi sub link and getting xpath.
Figure 8
9. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
1. XPATH generated is : //a[text()='Hindi']
2. Open Selenium IDE and give command as “highlight” or “Click”
3. Target is generated XPATH: //a[text()='Hindi']
4. Click on Find button in selenium IDE.
Results its highlights and click the "Hindi" Language.
See below screen.
Figure 9
2.3.1 Few points to note about XPATH:
An XPATH axis is a path through the node tree making use of particular relationship between nodes. We
use the "child::*" axis and the "attribute::*" axis all the time but mostly their short form: "*" and "@*".
The other axes are used far less often.
Follow below website to get good command on XPATH creation.
http://www.xmlplease.com/axis
CSS
Another way of locating the objects is by using CSS Selectors instead of XPATH:
Open the Selenium IDE > Options > Options> Locator Builders > Make sure CSS is present in the list
10. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 10
For this we can use DOM Inspector to get the elements, its attributes and its hierarchy
To locate a text field >
1. Open the www.google.co.in
2. Open the Selenium IDE
3. Record the Clicking on the Hindi link
4. Stop recording
5. Select the Target as css
11. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 11
Please refer the site http://www.w3schools.com/cssref/css_selectors.asp to learn about CSS
selectors
3.Install eclipse.exe:
1. Download Eclipse Standard 4.3.1 from web.
2. Install Eclipse by double click on eclipse.exe.
3. Give project location as Workspace.
4. See the screens to install eclipse
12. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 12
3.1 Install TestNG
1. Open the eclipse.exe
2. Goto Help > Install New Software
3. Give the url http://beust.com/eclipse in the Work with field
4. Click on Add
13. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
5. TestNG will be listed
6. Check the checkbox against TestNG
7. Click Next
Figure 13
8. Click Next until the License Agreement screen appears
9. Click “I agree” option
10. Installing Software pop up comes up
Figure 14
11. Once the installation is complete, open File> New> Other(or Ctrl + N) > Testing Class must be
listed in the window
14. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 16
3.2 Creating a Java project:
1. Goto to Workbench
2. Click on File > New > Java Project
Figure 17
3. Choose your JRE version, latest being JavaSE – 1.7
4. Click on Finish
15. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 18
5. Add the Selenium jar to the library ( File> Properties > Goto Libraries > Add External JARs .. >
Select the selenium-server-standalone-2.25.0.jar or the latest selenium jar
Figure 19
It should be added
16. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Figure 20
)
6. Create a new Class MyFirstAutomationScript.java
Figure 21
7. Import Testing packages
17. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
a. Click on MyFirstAutomationScript.java
b. Click New
c. Click TestNG class
d. Click @BeforeTest
e. Finish
Figure 22
8. Add the @BeforeTest method
9. Add the @AfterTest method
10. Add the test you have to do in the @Test annotation
import org.testng.annotations.Test;
import org.testng.annotations.BeforeTest;
import org.testng.annotations.AfterTest;
import org.openqa.selenium.By;
import org.seleniumhq.*;
import com.thoughtworks.selenium.Selenium;
import com.beust.testng.*;
import static org.testng.Assert.*;
public class MyFirstAutomationScript{
@Test
public void firstTest() {
//Write the selenium code to test a particular functionality
}
@BeforeTest
public void beforeTest() {
18. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
//Write the setup steps like starting the Selenium server, bringing
the application url up
}
@AfterTest
public void afterTest() {
//Write the cleanup steps like logging out of the application,
stopping the Selenium server
}
}
11. Click on the java class and Select Run as > TestNG Test
12. As a beginner in Automation, the first steps are to give proper logging setup. In TESTNG, we
have Reporter class which has logging functions which can be used.
Reporter.log("PASS : <font color="green"><b>"+ "Test case has
passed"+"</b></font><br/>");
The below given code is an example of how java classes and functions can be linked to xml files
Java classes and Functions:
We should write java functions to connect xml file and run the web application.
Write java class for each web component of application .Each java class is one component.
Template consists of set of functions as well as abstract methods.
Write java functions for each and every element (buttons, textbox) action items functions of particular
component.
Sample java code:
//import packages
//import Templates;
public class Template1 extends BaseTemplate
{
public static Template t1;
public static int i=0;
public static void function1 (ArrayList<StepData> stepDatas) throws Exception
{
Click ("elementid");
System.out.println ("Google");
}
}
19. Selenium with TESTNG and eclipse IDE- Automation Beginner’s guide
Each Java function should be called inside xml file, values passed inside xml file will be passed to java
function and execution will be done according to xml file steps.
XML file:
1. XML stands for EXtensible Markup Language
2. XML is a markup language much like HTML.
3. Here every test script is written in xml file format with steps having element value and ID of the
element.
4. Each XML file generation is used to run each test script.
Example:
<TestStep action="function name" type="template path">
<StepDatas>
<StepData value="elementid"></StepData>
<StepData value="elementvalue"></StepData>
</StepDatas>
</TestStep>
5. Each Test step is one single action in web application. Web page element id, values will be pass
as single individual steps .XML test script generation is main part in automation web application.
Conclusion:
This article provides the outline for setting up all the tools required to start automation using Selenium
with Java Eclipse IDE. Additional to this, knowledge of Core JAVA is required to test the functionalities.
This document in brief overview these points:
1. Setup all the required software
2. Get to know how to write basic classes and methods in Core JAVA
3. Using DOM Inspector, recognize the objects in web page
4. Run the tests as Testing Test
5. Reporting can be done by using the TestNG Reporter class.