These are training slides created by me to conduct training and knowledge sharing sessions for beginners in Cognizant Technology Solutions for Selenium Automation.
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
The presentation on Upgrading a mobile tester's weapons with advanced debugging was done during #ATAGTR2017, one of the largest global testing conference. All copyright belongs to the author.
Author and presenter : Abhijeet Vaikar
Automated UI testing done right (DDDSydney)Mehdi Khalili
Many teams try Automated UI Testing and many fail. Automated UI Testing is hard: the tests take a lot of time to write and tend to be brittle and hard to maintain. In this session I will provide you with some practical advice on how to and how not to write your tests introducing you to some UI testing ideas, patterns and frameworks that will help you write your tests faster while making them less brittle and easier to maintain.
This is an action packed session for testing enthusiasts.
Main instruments used for Web UI test automation.
Drivers: Selenium WebDriver, Sikuli X.
Frameworks: PageFactory, TestNG.
Other tools: Apache Ant, Jenkins CI.
Basic Introduction to selenium Webdriver in comparison with other selenium suite components along with architecture and element locators. Also explained about basic action commands used in selenium webdriver.
ATAGTR2017 Upgrading a mobile tester's weapons with advanced debuggingAgile Testing Alliance
The presentation on Upgrading a mobile tester's weapons with advanced debugging was done during #ATAGTR2017, one of the largest global testing conference. All copyright belongs to the author.
Author and presenter : Abhijeet Vaikar
Automated UI testing done right (DDDSydney)Mehdi Khalili
Many teams try Automated UI Testing and many fail. Automated UI Testing is hard: the tests take a lot of time to write and tend to be brittle and hard to maintain. In this session I will provide you with some practical advice on how to and how not to write your tests introducing you to some UI testing ideas, patterns and frameworks that will help you write your tests faster while making them less brittle and easier to maintain.
This is an action packed session for testing enthusiasts.
Main instruments used for Web UI test automation.
Drivers: Selenium WebDriver, Sikuli X.
Frameworks: PageFactory, TestNG.
Other tools: Apache Ant, Jenkins CI.
Basic Introduction to selenium Webdriver in comparison with other selenium suite components along with architecture and element locators. Also explained about basic action commands used in selenium webdriver.
Automation Testing using Selenium WebdriverPankaj Biswas
This will help you to understand about automation testing and when to do automation on your application using selenium. How selenium works, how to find web elements and what operations we can perform on the web elements to do automation.
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
This Selenium WebDriver tutorial talks about the drawbacks of Selenium RC and what was the need for Selenium WebDriver. It goes into the details of the avantages that WebDriver has over RC and how it replaced RC for automation testing. This tutorial will also tell you how WebDriver works and what are the different browser drivers you can use for testing. Watch the video to get a demonstration on how to locate various elements/ objects on the browser and how operations can be performed on those browser elements/ objects by writing Java code in Eclipse IDE.
Watch the video here: https://www.youtube.com/watch?v=ph3NJm4Z7m4
Using Selenium for Automated testing - basic level: short introduction into the selectors and basic methods used in writing a simple script with Selenium Webdriver.
Selenium is a software testing framework for automating tests of Web applications. Join Frank Cohen for a Workshop to learn the basics of Selenium. A screencast for this presentation is on the PushToTest.com Web site.
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Codemotion
In this talk, I would like to speak about best practices for writing e2e tests with Protractor. The styleguide that I will introduce, is a joint initiative of mine and @andresdom from Google. Some of the subjects that will be covered include why e2e testing is important, what e2e tests should cover, naming conventions, selector strategies, page objects, helper objects and performance considerations. That and lots of smileys obviously, because we wanted to smiley all the things ...right? ¯\_(ツ)_/¯
UI Testing Best Practices - An Expected JourneyOren Farhi
This slide focus on the good reasons for writing unit tests for testing ui.
Much like you're testing ui manually, you can have simple minimal code doing that for you.
Automation Testing using Selenium WebdriverPankaj Biswas
This will help you to understand about automation testing and when to do automation on your application using selenium. How selenium works, how to find web elements and what operations we can perform on the web elements to do automation.
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
This Selenium WebDriver tutorial talks about the drawbacks of Selenium RC and what was the need for Selenium WebDriver. It goes into the details of the avantages that WebDriver has over RC and how it replaced RC for automation testing. This tutorial will also tell you how WebDriver works and what are the different browser drivers you can use for testing. Watch the video to get a demonstration on how to locate various elements/ objects on the browser and how operations can be performed on those browser elements/ objects by writing Java code in Eclipse IDE.
Watch the video here: https://www.youtube.com/watch?v=ph3NJm4Z7m4
Using Selenium for Automated testing - basic level: short introduction into the selectors and basic methods used in writing a simple script with Selenium Webdriver.
Selenium is a software testing framework for automating tests of Web applications. Join Frank Cohen for a Workshop to learn the basics of Selenium. A screencast for this presentation is on the PushToTest.com Web site.
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Codemotion
In this talk, I would like to speak about best practices for writing e2e tests with Protractor. The styleguide that I will introduce, is a joint initiative of mine and @andresdom from Google. Some of the subjects that will be covered include why e2e testing is important, what e2e tests should cover, naming conventions, selector strategies, page objects, helper objects and performance considerations. That and lots of smileys obviously, because we wanted to smiley all the things ...right? ¯\_(ツ)_/¯
UI Testing Best Practices - An Expected JourneyOren Farhi
This slide focus on the good reasons for writing unit tests for testing ui.
Much like you're testing ui manually, you can have simple minimal code doing that for you.
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Edureka!
This Edureka Selenium tutorial will give you an introduction to software testing. It talks about the drawbacks of manual testing and reasons why automation testing is the way forward. In this Selenium tutorial, you will also get to learn the different suites of Selenium and what are the features and shortcomings of Selenium as an automation testing tool.
To take a structured course on Selenium, you can check our Selenium training page: https://www.edureka.co/testing-with-selenium-webdriver
Automation with Selenium Presented by Quontra SolutionsQuontra Solutions
Learn through Experience -- We differentiate our training and development program by delivering Role-Based training instead of Product-based training. Ultimately, our goal is to deliver the best IT Training to our clients.
In this training, attendees learn:
Introduction to Automation
• What is automation
• Advantages of automation & Disadvantages of automation
• Different types of Automation Tools
• What to automate in projects
• When to start automation. Scope for automation testing in projects
• About open-source automation tools
Introduction to Selenium
• What is selenium
• Why selenium
• Advantage and Disadvantages of selenium
Selenium components
• Selenium IDE
• Selenium RC
• Selenium WebDriver
• Selenium Grid
Selenium IDE
• Introduction to IDE
• IDE Installation
• Installation and uses of Firepath, Firebug & Debug bar
• Property & value of elements
• Selenium commands
• Assertions & Verification
• Running, pausing and debugging script
• Disadvantages of selenium IDE
• How to convert selenium IDE Scripts into other languages
Locators
• Tools to identify elements/objects
• Firebug
• IE Developer tools
• Google Chrome Developer tools
• Locating elements by ID
• Finding elements by name
• Finding elements by link text
• Finding elements by XPath
• Finding Elements by using CSS
• Summary
Selenium RC
• What is selenium RC
• Advantages of RC, Architecture
• What is Eclipse/IntelliJ, Selenium RC configure with Eclipse/IntelliJ
• Creating, running & debugging RC scripts
Java Concepts
• Introduction to OOPs concepts and Java
• Installation: Java, Eclipse/IntelliJ, selenium, TestNg/JUnit
• operators in java
• Data types in java
• Conditional statements in java
• Looping statements in java
• Output statements in java
• Classes & Objects
• Collection Framework
• Regular Expressions
• Exception Handling
• Packages, Access Specifiers /Modifiers
• String handling
• Log4J for logging
Selenium Web Driver with Java
• Introduction to WebDriver
• Advantages
• Different between RC and WebDriver
• Selenium WebDriver- commands
• Generate scripts in Eclipse/IntelliJ. Run Test Scripts.
• Debugging Test Script
• Database Connections
• Assertions, validations
• Working with Excel
• Pass the data from Excel
• Working with multiple browser
• Window Handling, Alert/confirm & Popup Handling
• Mouse events
• Wait mechanism
• Rich Web Handling: Calendar handing, Auto suggest, Ajax, browser forward/back navigation, keyboard events, certificate handling, event listeners
.....................For more visit http://www.quontrasolutions.co.uk/selenium-training-classes/
Mastering Test Automation: How To Use Selenium SuccessfullySpringPeople
In this slide, identify what to test and choose the best language for automation. Learn to write maintainable and reusable Selenium tests and add UI layout test as part of automation using Galen framework. This slide will also guide you in reporting structure by using external plugin's, an illustration covering cross browser testing (Running selenium grid with Docker) and explain Code repository (Git) and Jenkins CI tool.
Почти каждая Test Automation команда прикладывает много усилий и времени, чтобы построить и отполировать свой Framework. Никто не нуждается в Framework в первую очередь. Вместо этого нужны быстрые, надежные и простые тесты, которые работают и обеспечивают качество для текущего процесса разработки. На это митапе @Nikita Simonovets расскажет, как можно построить хорошую автоматизацию и на какие готовые решения и подходы стоит обратить внимание.
Agenda:
• Whois Test Automation Engineer?
• What is really WebDriver?
• What is really Test Automation Framework?
• Bad examples of Test Automation Solution
• How to write more stable tests
• Stairway to heaven: Selenide vs JDI
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.
Unmesh Gundecha delivered a session on "Selenium Powertools" at #SeleniumSummit21
Technology focused IT professional offering vast experience leveraging Software Engineering, Agile Software Development, Test Automation & DevOps methodologies to deliver highly effective and creative solutions to business and technology challenges. Utilizes highly attuned analytical skills to develop IT and business strategies employing leading/cutting-edge technologies to increase productivity & efficiency and organised with a strong capacity to prioritize workload, delegation, and steer project completion with established deadlines. Experience in building and leading small to a large specialist team on critical project deliveries. Passionate about Technology, Automation, UI/UX and Design.
To know more about #SeleniumSummit21 please check : https://seleniumsummit21.agiletestingalliance.org/
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Puneet Kala
Presentation from JAB-2014, I have talked about how we have setup PHPUnit and Selenium Webdriver for Testing Joomla CMS!,
How we can setup System test Suite for a Joomla! Component
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Atirek Gupta
A workshop on understanding how Selenium, Selenium/RC, Webdriver and browser works. Learning what is same origin policy with example. Hands on locating element using CSS and Xpath. Interacting with html with java script Finally developing a page object framework using java, webdriver from scratch.
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
Annotated slides from Berlin PHP Usergroup Meetup, 4th April 2017.
---
Not only unit tests but also end-to-end tests in real browser are important part of test automation and test pyramid. So let's have a look how to easily write and run Selenium functional tests using PHPUnit and Steward.
Top 15 Selenium WebDriver Interview Questions and Answers.pdfAnanthReddy38
Supports multiple programming languages (Java, C#, Python, etc.)
Works with different web browsers (Chrome, Firefox, Safari, etc.)
Provides a rich set of methods for interacting with web elements
Supports parallel test execution
Integrates well with test frameworks and continuous integration tools
How do you launch a browser using Selenium WebDriver?
In Java, you can launch a browser using WebDriver with the following
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
GridMate - End to end testing is a critical piece to ensure quality and avoid...ThomasParaiso2
End to end testing is a critical piece to ensure quality and avoid regressions. In this session, we share our journey building an E2E testing pipeline for GridMate components (LWC and Aura) using Cypress, JSForce, FakerJS…
A tale of scale & speed: How the US Navy is enabling software delivery from l...sonjaschweigert1
Rapid and secure feature delivery is a goal across every application team and every branch of the DoD. The Navy’s DevSecOps platform, Party Barge, has achieved:
- Reduction in onboarding time from 5 weeks to 1 day
- Improved developer experience and productivity through actionable findings and reduction of false positives
- Maintenance of superior security standards and inherent policy enforcement with Authorization to Operate (ATO)
Development teams can ship efficiently and ensure applications are cyber ready for Navy Authorizing Officials (AOs). In this webinar, Sigma Defense and Anchore will give attendees a look behind the scenes and demo secure pipeline automation and security artifacts that speed up application ATO and time to production.
We will cover:
- How to remove silos in DevSecOps
- How to build efficient development pipeline roles and component templates
- How to deliver security artifacts that matter for ATO’s (SBOMs, vulnerability reports, and policy evidence)
- How to streamline operations with automated policy checks on container images
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
2. TESTAUTOMATIONTODAY
Web UI Test Automation
Selenium, Watir, PhantomJS, CasperJS, Sahi, QTP, SauceLabs
Native Desktop UI Automation
AutoIt, Sikuli, QTP, TestComplete
Mobile App Test Automation
MonkeyTalk, Calabash, Selendroid, Appium, EggPlant
Performance Test Automation
JMeter, Load Runner, NeoLoad, HttPerf
3. SAYHELLOTOSELENIUM!
Who am I?
A set of open source tools to interact with browser application in an automated way.
What are my tools?
Selenium IDE, Selenium 1 (RC), Selenium 2 (WebDriver)
Who are my creators?
Selenium 1 - Jason Huggins, Selenium 2 - Simon Stewart
4. SELENIUMROCKS!SAYHOW?
Limitless possibilities of using Selenium
Possible interesting uses:
Test Automation, ofcourse!
Web data scraping
Performing CRUDs on a webpage repetitively (Bulk data
creation from the UI)
As a content downloader!
Automated reply to Facebook posts?
5. HOWWASSELENIUMEARLIER??
Called as Selenium RC (Remote Control), had a server which
launches, stops and interacts with the browser.
Selenium Commands from code -> RC Server -> Javascript
commands to browser
Client libraries used HTTP GET / POST to interact with the
selenium server
Selenium Server used Selenium Core which was a set of JS
programs that were injected into the browser for executing the
commands sent.
Client libraries were in Python, Ruby, Java, .NET, PHP, Perl
8. WEBDRIVER
Binds natively to the browser. No Javascript injection in browser's JS Sandbox
Better object oriented API
Bindings for Java, Python, C#, Ruby, Perl, Php, JS
Significantly fewer calls than Selenium RC
Variants: ChromeDriver, FireFoxDriver, InternetExplorerDriver, OperaDriver, AndroidDriver,
IPhoneDriver, HtmlUnitDriver
Overcomes same origin policy problem
Self-contained library. No server to start explicitly.
13. DRIVINGTHEDRIVER
Interface - IWebDriver; Implements - ISearchContext, IDisposable
Functionality - Controls the browser, Finds elements, Helps in debugging
Usage - Creating instance of a flavor of webdriver class that implements this interface
Commonly used methods - FindElement, FindElements, Manage, Navigate, Quit, Close
Commonly used properties - Title, URL
14. WEBELEMENT
Interface - IWebElement; Implements - ISearchContext
Functionality - Provides methods to identify and interact with DOM
elements on web page. Instance of it represents a HTML element.
Usage: Created using FindElement / FindElements method on driver
instance or another webelement object.
Commonly used methods: Click, SendKeys, Clear, Submit,
GetAttribute, GetCssValue
Commonly used properties: Displayed, Text, Enabled, Selected,
TagName
15.
16. ELEMENTLOCATING
Use By class to locate elements
By class provides following static member methods:
CssSelector
ClassName
Id
XPath
TagName
LinkText
PartialLinkText
Name
Subclass the By class to build your own locating mechanism. Eg: ByIdOrName
17. LOCATINGBYID
Id is the King!
W3C standards state Ids should be unique.
Independent from the type of element.
Developers usually give ids to elements which contain dynamic
elements. Benefit!
If your developer doesn't add ids, convince him to do so!
18. LOCATINGBYCSS/XPATHSELECTORS
css prefered over xpath.
xpath engines different for different browsers.
xpath tend to become complex and difficult to read.
xpath useful when you want to fetch parent element or
find element by text.
20. "A good way to start a CSS or Xpath locator is to start with an
element that you know is not likely to change much and use it
as an ‘anchor’ in your locator. It may have an ID or stable location
but not be the element you need to locate but is a reliable position to
search from. Your anchoring element can be above or below the
current element in the HTML tree, but most often it’s above."
How do I find the <li> ??
21. INDEXANDDESCENDANTLOCATORS
Index locators
nth-child(), nth-of-type()
Use when finding element in a list, by index
Nth-child example: p:nth-child(2)
Nth-of-type: p:nth-of-type(2)
Descendant Locators
Use when finding direct child elements of parent
CSS example: div > div > ul > li > span
Xpath example: //div/div/ul/li/span
23. YOUNEEDTOWAITFORMR.AJAX!
AJAX (Asynchronous Javascript & XML)
Dynamic content rendered and updated with the help of
AJAX and Javascript
This calls for the need to test dynamic UI which has time
uncertainty
WebDriver handles this using Implict and Explict waiting mechanism
Link: WebDriver Wait Commands
24. COMMONEXCEPTIONS
ElementNotVisibleException : Use Javascript to make element visible
IllegalLocatorException: when By.className() is used with a compound class name.
NoSuchElementException: Use waits OR verify your locator
StaleElementReferenceException: Happens if a DOM operation happening on the page is
temporarily causing the element to be inaccessible.
public boolean retryFindClick(By by) {
boolean result = false;
int attempts = 0;
while(attempts < 2) {
try {
driver.findElement(by).click();
result = true;
break;
} catch(StaleElementException e) {
}
attempts++;
}
return result;
25. IJAVASCRIPTEXECUTOR
Used to execute javascript on webpage.
Can be used for finding elements
Performing actions like click or selecting control
Syntax:
IJavaScriptExecutor jsExec = (IJavaScriptExecutor)_driver;
_searchTextField = (IWebElement)jsExec.ExecuteScript("return document.getElementBy
_searchTextField.SendKeys(searchString);