Как писать автотесты на java selenium

от admin

Пишем автотест с использованием Selenium Webdriver, Java 8 и паттерна Page Object

В этой статье рассматривается создание достаточного простого автотеста. Статья будет полезна начинающим автоматизаторам.

Материал изложен максимально доступно, однако, будет значительно проще понять о чем здесь идет речь, если Вы будете иметь хотя бы минимальные представления о языке Java: классы, методы, etc.

  • установленная среда разработки Intellij IDEA (является самой популярной IDE, для большинства случаев достаточно бесплатной версии Community Edition);
  • установленные Java (jdk/openjdk) и Maven, прописанные в системные окружения ОС;
  • браузер Chrome и chromedriver — программа для передачи команд браузеру.

Создание проекта

Запустим Intellij IDEA, пройдем первые несколько пунктов, касающихся отправки статистики, импорта проектов, выбора цветовой схемы и т.д. — просто выберем параметры по умолчанию.

В появившемся в конце окне выберем пункт «Create New Project», а в нем тип проекта Maven. Окно будет иметь вид:

  • Maven — это инструмент сборки Java проектов;
  • Project SDK — версия Java, которая установлена на компьютере;
  • Create from archetype — это возможность создавать проект с определенным архетипом (на данном этапе данный чекбокс отмечать не нужно).

Нажмем «Next». Откроется следующее окно:

image

Groupid и Artifactid — идентификаторы проекта в Maven. Существуют определенные правила заполнения этих пунктов:

  • Groupid — название организации или подразделения занимающихся разработкой проекта. В этом пункте действует тоже правило как и в именовании пакетов Java: доменное имя организации записанное задом наперед. Если у Вас нет своего доменного имени, то можно использовать свой э-мейл, например com.email.email;
  • Artifactid — название проекта;
  • Version — версия проекта.

Нажмем «Finish»: IDE автоматически откроет файл pom.xml:

image

В нем уже появилась информация о проекте, внесенная на предыдущем шаге: Groupid, Artefiactid, Version. Pom.xml — это файл который описывает проект. Pom-файл хранит список всех библиотек (зависимостей), которые используются в проекте.

Для этого автотеста необходимо добавить две библиотеки: Selenium Java и Junit. Перейдем на центральный репозиторий Maven mvnrepository.com, вобьем в строку поиска Selenium Java и зайдем в раздел библиотеки:

image

Выберем нужную версию (в примере будет использована версия 3.14.0). Откроется страница:

image

Копируем содержимое блока «Maven» и вставим в файл pom.xml в блок

Таким образом библиотека будет включена в проект и ее можно будет использовать. Аналогично сделаем с библиотекой Junit (будем использовать версию 4.12).

image

Создание пакета и класса

Раскроем структуру проекта. Директория src содержит в себе две директории: «main» и «test». Для тестов используется, соответственно, директория «test». Откроем директорию «test», кликом правой клавиши мыши по директории «java» выберем пункт «New», а затем пункт «Package». В открывшемся диалоговом окне необходимо ввести название пакета. Имя базового пакета должно носить тоже имя, что и Groupid — «org.example».

Следующий шаг — создание класса Java, в котором пишется код автотеста. Кликом правой клавиши мыши по названию пакета выберем пункт «New», а затем пункт «Java Class».

В открывшемся диалоговом окне необходимо ввести имя Java класса, например, LoginTest (название класса в Java всегда должно начинаться с большой буквы). В IDE откроется окно тестового класса:

image

Настройка IDE

Прежде чем начать, необходимо настроить IDE. Кликом правой клавиши мыши по названию проекта выберем пункт «Open Module Settings». В открывшемся окне во вкладке «Sources» поле «Language level» по умолчанию имеет значение 5. Необходимо изменить значение поля на 8 (для использования всех возможностей, присутствующих в этой версии Java) и сохранить изменения:

image

Далее необходимо изменить версию компилятора Java: нажмем меню «File», а затем выберем пункт Settings.

В открывшемся перейдем «Build, Execution, Deployment» -> «Compiler» -> «Java Compiler». По умолчанию установлена версия 1.5. Изменим версию на 8 и сохраним изменения:

image

Test Suite

  1. Пользователь открывает страницу аутентификации;
  2. Пользователь производит ввод валидных логина и пароля;
  3. Пользователь удостоверяется в успешной аутентификации — об этом свидетельствует имя пользователя в верхнем правом углу окна;
  4. Пользователь осуществляет выход из аккаунта путем нажатия на имя пользователя в верхнем правом углу окна с последующим нажатием на кнопку «Выйти…».

Тест считается успешно пройденным в случае, когда пользователю удалось выполнить все вышеперечисленные пункты.

Для примера будет использоваться аккаунт Яндекс (учетная запись заранее создана вручную).

Первый метод

В классе LoginTest будет описана логика теста. Создадим в этом классе метод «setup()», в котором будут описаны предварительные настройки. Итак, для запуска браузера необходимо создать объект драйвера:

Перед созданием объекта WebDriver следует установить зависимость, определяющую путь к chomedriver (в ОС семейства Windows дополнительно необходимо указывать расширение .exe):

Чтобы ход теста отображался в полностью открытом окне, необходимо сказать об этом драйверу:

Случается, что элементы на страницах доступны не сразу, и необходимо дождаться появления элемента. Для этого существуют ожидания. Они бывают двух видов: явные и неявные. В примере будет использовано неявное ожидание Implicitly Wait, которое задается вначале теста и будет работать при каждом вызове метода поиска элемента:

Таким образом, если элемент не найден, то драйвер будет ждать его появления в течении заданного времени (10 секунд) и шагом в 500 мс. Как только элемент будет найден, драйвер продолжит работу, однако, в противном случае тест упадем по истечению времени.

Для передачи драйверу адреса страницы используется команда:

Выносим настройки

Для удобства вынесем название страницы в отдельный файл (а чуть позже и некоторые другие параметры).

Создадим в каталоге «test» еще один каталог с названием «resources», а в нем обычный файл «conf.properties», в который поместим переменную:

а также внесем сюда путь до драйвера

image

В пакете «org.example» создадим еще один класс «ConfProperties», который будет читать записанные в файл «conf.properties» значения:

image

Обзор первого метода

image

Метод «setup()» пометим аннотацией Junit «@BeforeClass», которая указывает на то, что метод будет выполняться один раз до выполнения всех тестов в классе. Тестовые методы в Junit помечаются аннотацией Test.

Page Object

При использовании Page Object элементы страниц, а также методы непосредственного взаимодействия с ними, выносятся в отдельный класс.

Создадим в пакете «org.example» класс LoginPage, который будет содержать локацию элементов страницы логина и методы для взаимодействия с этими элементами.

Откроем страницу авторизации в сервисах Яндекс (https://passport.yandex.ru/auth) в браузере Chrome. Для определения локаторов элементов страницы, с которыми будет взаимодействовать автотест, воспользуемся инструментами разработчика. Кликом правой кнопки мыши вызовем меню «Просмотреть код». В появившейся панели нажмем на значок курсора (левый верхний угол панели разработчика) и наведем курсор на интересующий нас элемент — поле ввода логина.

В результате мы увидим этот элемент среди множества других. Теперь мы можем скопировать его локацию. Для этого кликаем правой кнопкой мыши по выделенному в панели разработчика элементу, выбираем меню «Copy» -> «Copy XPath».

Для локации элементов в Page Object используется аннотация @FindBy.

Напишем следующий код:

Таким образом мы нашли элемент на страницу и назвали его loginField (элемент доступен только внутри класса LoginPage, т.к. является приватным).

Однако, такой длинный и страшный xpath использовать не рекомендуется (рекомендую к прочтению статью «Не так страшен xpath как его незнание». Если присмотреться, то можно увидеть, что поле ввода логина имеет уникальный id:

image

Воспользуемся этим и изменим поиск элемента по xpath:

Теперь вероятность того, что поле ввода пароля будет определено верно даже в случае изменения местоположения элемента на странице, возросла.

Аналогично изучим следующие элементы и получим их локаторы.

Поле ввода пароля:

А теперь напишем методы для взаимодействия с элементами.

Метод ввода логина:

Метод ввода пароля:

Метод нажатия кнопки входа:

Для того, чтобы аннотация @FindBy заработала, необходимо использовать класс PageFactory. Для этого создадим конструктор и передадим ему в качестве параметра объект Webdriver:

image

После авторизации мы попадаем на страницу пользователя. Т.к. это уже другая страница, в соответствии с идеологией Page Object нам понадобится отдельный класс для ее описания. Создадим класс ProfilePage, в котором определим локаторы для имени пользователя (как показателя успешного входа в учетную запись), а также кнопки выхода из аккаунта. Помимо этого, напишем методы, которые будут получать имя пользователя и нажимать на кнопку выхода.

Итого, страница будет иметь следующий вид:

image

Интересный момент: в метод getUserName() пришлось добавить еще одно ожидание, т.к. страница «тяжелая» и загружалась довольно медленно. В итоге тест падал, потому что метод не мог получить имя пользователя. Метод getUserName() с ожиданием:

Вернемся к классу LoginTest и добавим в него созданные ранее классы-страницы путем объявления статических переменных с соответствующими именами:

Сюда же вынесем переменную для драйвера

В аннотации @BeforeClass создаем экземпляры классов созданных ранее страниц и присвоим ссылки на них. Создание экземпляра происходит с помощью оператора new. В качестве параметра указываем созданный перед этим объект driver, который передается конструкторам класса, созданным ранее:

А создание экземпляра драйвера приведем к следующему виду (т.к. он объявлен в качестве переменной):

Теперь можно перейти непосредственно к написанию логики теста. Создадим метод loginTest() и пометим его соответствующей аннотацией:

Осталось лишь корректно все завершить. Создадим финальный метод и пометим его аннотацией @AfterClass (методы помеченные этой аннотацией выполняются один раз, после завершения всех тестовых методов класса).

В этом методе осуществляется вход в меню пользователя и нажатие кнопки «Выйти», чтобы разлогиниться.

Последняя строка нужна для закрытия окна браузера.

Обзор теста

Запуск автотеста

Для запуска автотестов в Intellij Idea имеется несколько способов:

  • Alt+Shift+F10;
  • Клик правой клавишей мышки по имени тестового класса, после чего в открывшемся меню выбрать Run;

В результате выполнения автотеста, в консоли Idea я вижу, что тестовый метод loginTest() пройден успешно:

Как писать автотесты с Selenium

Как писать автотесты с Selenium

Автоматизируем проверку имени пользователя на Java.

Selenium — это инструмент с открытым кодом для автоматизации тестирования WEB. С его помощью можно заменить рутинные операции, которые вынуждены делать мануальные тестировщики. Например, текстовый ввод или однотипные взаимодействия со множеством элементов страниц. Также Selenium облегчает тестирование разных локализаций, потому что взаимодействие с элементами страницы происходит на уровне кода.

Плюс Selenium в том, что он поддерживает самые популярные языки программирования (Java, Python, JavaScript, PHP).

Что нужно знать.

Чтобы лучше понять, как работает Selenium, напишем тест на Java.

Сравнение имени пользователя и логина: пишем код

Напишем тест, который будет открывать «Википедию», логиниться и проверять, соответствует ли имя пользователя его логину.

  • 1. Устанавливаем WebDriver— драйвер, который управляет работой браузера (открывает страницы и отправляет им команды). Тест будет написан для Chrome, поэтому понадобится драйвер для последней версии Chrome.
  • 2. Подтягиваем зависимость для Selenium-java в pom.xml Maven-проекта.
  • 3. Создаем три класса в папке Test:
    • WikiLoginPage (отвечает за работу со страницей авторизации).
    • WikiMainPage (отвечает за страницу, которая загружается после авторизации).
    • WikiLoginTest (основной тестовый класс).

    Также необходимо выставить небольшую задержку в 5 секунд, чтобы все статические элементы страницы успели загрузиться — timeouts().implicitlyWait(Duration.ofSeconds(5)). Аннотация @BeforeClass говорит о том, что этот метод будет вызван только один раз до запуска всех тестов. Метод quitDriver завершает работу драйвера и закрывает браузер.

    Аннотация @AfterClass обеспечивает его вызов только после того, как отработают все остальные методы. В переменные name и password прописываем данные пользователя, которые будем проверять.

    Simple Selenium Test Automation Project in Java With Page Object Model

    How to optimize your tests using the Page Object Model.

    What is PageObject?

    Page Object Model is an object design pattern, in which for every web page in the application, there should be a relevant page class, various elements on the page are defined as variables on the class. To interact with different elements of web page methods are implemented in the class.

    Why should we use the Page Object Model?

    So now with every change on a webpage, we have to change the code of our tests only in one place.

    Can you imagine changing one element on a web page that 10 or 100 tests depend on? That is a time-consuming work that increases the cost of code maintenance and it is a great obstacle for implementing automated tests in the early stages of any agile project.

    Basically, Page Object is a way to separate the webpage description (locators) and test logic. So now with every change on a webpage, we have to change the code of our tests only in one place.

    Let’s take a look at the advantages of using the PageObject Model.

    • Our tests are separated from locators, that reduces code duplication significantly and helps keep code clean.
    • Due to well-named methods in classes, code is easy to read and to maintain.
    • Tests are more concise because we are using existing methods of page object classes.
    • Any changes in the webpage can easily be implemented, in one place, that is in our Page Object Class.

    Getting Ready

    To create a Page Object Model of our website, first of all, we create a class in our automation framework to represent the corresponding page of our application.

    The value of class variables are, in fact, locators to the elements on the actual web page. After defining these locators in page object classes, there is no need to hardcode them every time we use them in tests.

    There are different types of locators: ID, Name, ClassName, CSS, XPath. In this tutorial, we will use XPaths as locators. Read more about XPath here.

    Now that we’ve defined our variables we can create methods to interact with them.

    It is a good practice to write convenience methods. For example, to log into the account we need to call three different methods(set user email, set user password, click on Join), so it’s a good idea to unite all these actions in one method.

    What is PageFactory?

    Page Factory in Selenium is an inbuilt Page Object Model concept for Selenium WebDriver. It is used for the initialization of the Page object. It is also used to initialize Page class elements without using the findElement() method.

    Here is how our code would look like without using PageFactory:

    Instead, with the help of the PageFactory class, we use annotations @FindBy to find WebElement.

    And then we use the initElements () method on PageFactory.

    Or, inside the web page class constructor:

    Page Factory will initialize every WebElement variable with @ FindBy annotation.

    Checkboxes and Toggles and RadioButtons

    To work with checkboxes, toggles, or radio buttons, instead of blindly clicking on them, it’s better to check their status first. To do that use isSelected() method.

    Simple Selenium Test Automation Project in Java

    For the purpose of our Page Object Model tutorial, let’s automate sign in for GitHub. To do that, we need to automate the following steps:

    2. Click on the Sign In button

    3. Fill out email and password

    4. Click on Sign In Button

    Setting Up the Project

    To separate the logic of tests and our page object classes we will put them in different folders.

    Name already in use

    automation-testing-with-java-and-selenium / README.md

    • Go to file T
    • Go to line L
    • Copy path
    • Copy permalink
    • Open with Desktop
    • View raw
    • Copy raw contents Copy raw contents

    Copy raw contents

    Copy raw contents

    Learn Automation Testing with Java and Selenium

    Your First Steps towards Great Automation Tester

    • Eclipse — https://courses.in28minutes.com/p/eclipse-tutorial-for-beginners
    • Maven — https://courses.in28minutes.com/p/maven-tutorial-for-beginners-in-5-steps
    • JUnit — https://courses.in28minutes.com/p/junit-tutorial-for-beginners
    • Mockito — https://courses.in28minutes.com/p/mockito-for-beginner-in-5-steps
    • Installation Video : https://www.youtube.com/playlist?list=PLBBog2r6uMCSmMVTW_QmDLyASBvovyAO3
    • GIT Repository For Installation : https://github.com/in28minutes/getting-started-in-5-steps
    • PDF : https://github.com/in28minutes/SpringIn28Minutes/blob/master/InstallationGuide-JavaEclipseAndMaven_v2.pdf
    • Download the zip or clone the Git repository.
    • Unzip the zip file (if you downloaded one).
    • Open Command Prompt and Change directory (cd) to folder containing pom.xml
    • Open Eclipse
      • File -> Import -> Existing Maven Project -> Navigate to the folder where you unzipped the zip
      • Select the right project
      • Manual Installation — https://github.com/lmc-eu/steward/wiki/Selenium-server-&-browser-drivers
      • Automated Installation — https://www.npmjs.com/package/selenium-standalone
      • URL — http://localhost:4444/wd/hub

      Installation and Launch

      • Step I : Install NPM
      • Step II : Install selenium-standalone Terminal or Command Prompt
      • Step III : Launch Selenium Standalone

      By default, google chrome, firefox and phantomjs are available when installed on the host system

      • More Options — https://www.npmjs.com/package/selenium-standalone#command-line-interface
      • URL -http://localhost:4444/grid/console

      Installation and Launch

      • Follow Step I and II of Selenium Standalone
      • Step III

      Excel Data Reader

      • Eclipse Plugin for TestNg — http://beust.com/eclipse
      • Selenium IDE will no longer work from Firefox 55
      • Troubleshooting Guide — https://github.com/in28minutes/in28minutes-initiatives/tree/master/The-in28Minutes-TroubleshootingGuide-And-FAQ
      • Troubleshooting Guide for Maven Issues — https://github.com/in28minutes/in28minutes-initiatives/tree/master/The-in28Minutes-TroubleshootingGuide-And-FAQ#error—you-are-not-using-a-jdk
      • WebDriver Specification — https://www.w3.org/TR/webdriver/
      • Firefox version 47.0+ Geckodriver is needed to interact with Firefox — Similar to Chrome.

      Writing your first automation test is a lot of fun.

      Java is one of the most popular programming languages. Java offers both object oriented and functional programming features. Selenium can be used for screen scraping and automating repeated tasks on browser.

      In this course, you will learn the basics of programming with Java and Automation Testing with Selenium.

      We take an hands-on approach using Eclipse as an IDE to illustrate more than 200 Java Coding Exercises, Puzzles and Code Examples. We will also write more than 100 Selenium automation tests with Java for a wide variety of scenarios.

      In more than 350 Steps, we explore the most important Java Programming Features and Selenium Automation Testing Scenarios

      • Basics of Java Programming — Expressions, Variables and Printing Output
      • Using Selenium IDE and Katalon Studio to Record and Replay Automation Testing Scenarios
      • Exporting Automation Tests and Setting up new Maven Project for JUnit and TestNG
      • TestNG vs JUnit
      • TestNG Advanced Features — XML Suite, Test Reports, Running Tests with Parameters defined in XML and Running Tests in Parallel
      • Basics of HTML, CSS and XPath
      • Selenium Locators — By Id, By Name, By Link Text, By Partial Link Text, By Class, CSS Selectors and XPath Expressions
      • Setting and Reading values from Form Elements — Text, TextArea, CheckBox , Radio Button, Select Box and Multi Select Box
      • Advanced Selenium Automation Testing Scenarios — Playing with Windows, Modal Windows (Sleep, Implicit Wait and Explicit Waits), Alert Boxes, Window Handles and New Browser Window Launches, Frames, Taking Screenshots, Executing JavaScript Code, Actions Interface to control mouse and keyboard
      • Set up Automation Testing Frameworks — Tables
      • Important Interfaces — WebDriver
      • Introduction to Cross Browser Automation Testing, Headless Testing and Setting up a Basic Cross Browser Automation Testing Framework
      • Writing Data Driven Testing with Data Providers, CSV and Excel Spreadsheets
      • Implementing Page Object Model for a Complex Test Scenario
      • Scaling up with Selenium Standalone and Grid
      • Java Operators — Java Assignment Operator, Relational and Logical Operators, Short Circuit Operators
      • Java Conditionals and If Statement
      • Methods — Parameters, Arguments and Return Values
      • An Overview Of Java Platform — java, javac, bytecode, JVM and Platform Independence — JDK vs JRE vs JVM
      • Object Oriented Programming — Class, Object, State and Behavior
      • Basics of OOPS — Encapsulation, Abstraction, Inheritance and Polymorphism
      • Basics about Java Data Types — Casting, Operators and More
      • Java Built in Classes — BigDecimal, String, Java Wrapper Classes
      • Conditionals with Java — If Else Statement, Nested If Else, Java Switch Statement, Java Ternary Operator
      • Loops — For Loop, While Loop in Java, Do While Loop, Break and Continue
      • Java Array and ArrayList — Java String Arrays, Arrays of Objects, Primitive Data Types, toString and Exceptions
      • Java Collections — List Interface(ArrayList, LinkedList and Vector), Set Interface (HashSet, LinkedHashSet and TreeSet), Queue Interface (PriorityQueue) and Map Interface (HashMap, HashTable, LinkedHashMap and TreeMap() — Compare, Contrast and Choose
      • Generics — Why do we need Generics? Restrictions with extends and Generic Methods, WildCards — Upper Bound and Lower Bound.
      • Introduction to Exception Handling — Your Thought Process during Exception Handling. try, catch and finally. Exception Hierarchy — Checked Exceptions vs Unchecked Exceptions. Throwing an Exception. Creating and Throwing a Custom Exception — CurrenciesDoNotMatchException. Try with Resources — New Feature in Java 7.

      You will be using Eclipse and Brackets as the IDE. You will be using Maven, npm (Dependency Management), TestNG (XML Test Suite, Parallel, Multiple Browsers), JUnit, Selenium IDE, Katalon Studio, Selenium Standalone and Selenium Grid. We will help you set up each one of these.

      • Tools : Maven, JUnit, TestNG (XML Test Suite, Groups, Listeners, Parallel, Multiple Browsers), Selenium IDE, Katalon Studio, Brackets
      • Concepts : HTML, DOM, XPath, Selenium Architecture, Reporting (HTML), Parallel Execution (Data Driven Tests, Browsers, Test Ng, Grid), Debugging (Screenshots/logs), Page Object Model, Data Driven(Excel), Keyword Driven, Record and Replay, Selenium Grid, Cross Browser Testing, DRY
      • Basics : Selenium Web Driver, Locating Web Elements(link text, name, id, xpath, css), Different Elements(select, radio, web tables, drag and drop, javascript alerts, windows, popups, iframes, switching windows), Wait (Explicit/Implicit), JavaScript Executor Action Class, Mouse movement, Keyboard with Selenium)
      • Tips : Selenium Web Driver is an Interface, Headless Testing(PhantomJS, Chrome)

      What You will learn

      • You will learn how to think as a Java Programmer
      • You will learn how to start your journey as a Java Programmer
      • You will learn the basics of Eclipse IDE and JShell
      • You will learn to develop awesome object oriented programs with Java
      • You will learn to use Selenium IDE and Katalon Studio to Record and Replay Automation Testing Scenarios
      • You will learn to setup new automation projects with Selenium, Web Driver, JUnit and TestNG Frameworks
      • You will learn some of the TestNG Advanced Features — XML Suite, Test Reports, Test Parameters and Parallel Execution
      • You will learn the basics of HTML, CSS and XPath
      • You will understand all Selenium Locators — By Id, By Name, By Link Text, By Partial Link Text, By Class, CSS Selectors and XPath Expressions
      • You will learn to play with Form Elements — Text, TextArea, CheckBox , Radio Button, Select Box and Multi Select Box
      • You will learn to write automation test for wide range of scenarios — Playing with Windows, Modal Windows (Sleep, Implicit Wait and Explicit Waits), Alert Boxes, Window Handles and New Browser Window Launches, Frames, Taking Screenshots, Executing JavaScript Code, Actions Interface to control mouse and keyboard
      • You will learn to Set up Automation Testing Frameworks for Form Elements, Tables and Cross Browser Testing
      • You will learn to write Data Driven Tests with Data Providers, CSV and Excel Spreadsheets
      • You will learn to implement Page Object Model for a Complex Automation Test Scenario
      • You will learn to parallelize and scale up Automation Tests with Selenium Standalone and Grid
      • You should have the ability to learn while having fun!
      • Connectivity to Internet to download various tools needed.
      • We will help you install Selenium IDE, Katalon Studio, Brackets, Java, NodeJs and Eclipse.
      • We will help you download all needed dependencies using Maven and NPM

      Step Wise Details

      • 00 — 00 Introduction to Automation Testing with Java and Selenium
      • 00 — 01 Automation Testing with Java and Selenium — Course Guide.pdf
      • 00 — 02 How To Make Best use of the Course Guide?
      • 00 — 03 Installing Java and Eclipse

      01 — Getting Started with Selenium, JUnit and TestNG

      • Step 01 — Getting Started with Selenium — An Overview
      • Step 02 — Installing Selenium IDE
      • Step 03 — Recording and Replaying Google Search with Selenium IDE
      • Step 04 — Exercise — Recording Facebook Login
      • Step 05 — Advanced Features in Selenium IDE
      • Step 06 — Alternative for Selenium IDE — Katalon Studio
      • Step 07 — Installing and Recording Tests with Katalon Studio
      • Step 08 — Advanced Features of Katalon Studio
      • Step 09 — Export Unit Tests and Set up new Maven Project
      • Step 10 — Adding Maven Dependencies for JUnit, Web Driver Manager and Web Driver
      • Step 11 — Fixing Driver Error with ChromeDriverManager
      • Step 12 — Exercise — Run Facebook JUnit Test
      • Step 13 — Running a Selenium Automation Test — What is happening in Background
      • Step 14 — Install TestNG Plugin and Create New Project with TestNG
      • Step 15 — Export and Run TestNG Test for Google and Facebook
      • Step 16 — Comparing TestNG and JUnit Tests and Course Overview

      02 — TestNG vs JUnit

      • Step 01 — Introduction to TestNG vs JUnit
      • Step 02 — Creating a Unit Test for SimpleClass
      • Step 03 — Adding Asserts to Unit Test
      • Step 04 — Exercise — Write more unit test Scenarios
      • Step 05 — Writing Selenium JUnit Automation Test for Google — Part 1
      • Step 06 — Writing Selenium JUnit Automation Test for Google — Part 2
      • Step 07 — Exploring WebDriver Interface
      • Step 08 — Writing Selenium JUnit Automation Test for Google — Part 3
      • Step 09 — Reducing Duplication with @Before and @After JUnit Annotations
      • Step 10 — Time for TestNG — Convert Unit Test to TestNG
      • Step 11 — TestNG Advanced Features — XML Suite and Test Reports
      • Step 12 — TestNG Advanced Features — Running Tests with Parameters defined in XML
      • Step 13 — TestNG Advanced Features — Running Tests in Parallel

      03 — Getting Started with HTML, CSS and XPath

      • Step 01 — Why should you learn HTML and CSS
      • Step 02 — How does Web Work — Request, Response, HTML and Browser
      • Step 03 — Installing Web Editor — Brackets
      • Step 04 — First HTML File — Tags, HTML, Head and Body
      • Step 05 — Basic HTML Tags — Paragraph, Div, Heading — H1 to H6
      • Step 06 — Formatting Tags — Bold, Italicized and Quotes
      • Step 07 — Using Tags without closing tag — BR and HR
      • Step 08 — W3C Standards for HTML
      • Step 09 — Creating List of elements with UL LI and OL
      • Step 10 — Organizing Your Data Using Tables
      • Step 11 — Organizing Your Data Using Tables — Exercise Solutions
      • Step 12 — HTML Attributes and Links — Absolute and Relative
      • Step 13 — Image Tag in HTML — Local and Internet Links
      • Step 14 — Introduction to Live Preview Feature in Brackets
      • Step 15 — Nesting of Divs and Understanding align Attribute
      • Step 16 — Getting Data from User using Forms — Text and TextArea
      • Step 17 — Attributes on Text Elements — Size, maxlength, value
      • Step 18 — Choosing among multiple options using Radio Buttons
      • Step 19 — Choosing among multiple options using Select Box
      • Step 20 — Choosing Yes or No with Check Box
      • Step 21 — Submitting a Form and Understanding GET and POST
      • Step 22 — Introduction to Frames
      • Step 23 — Miscellaneous — Password Fields, File Input and Multi Select Box
      • Step 24 — Introduction to CSS
      • Step 25 — CSS for input, select and text area
      • Step 26 — CSS attributes with color, background color
      • Step 27 — Grouping Form Elements with fieldset
      • Step 28 — Styling Fieldsets with CSS
      • Step 29 — Exercise — Styling Lists
      • Step 30 — Using an External CSS File
      • Step 31 — Understanding Class in CSS
      • Step 32 — Making best use of Class in CSS and Multiple Classes
      • Step 33 — Using id with CSS
      • Step 34 — Understanding CSS Selectors and Testing using $$ function
      • Step 35 — CSS Selectors — Identifying Input Element
      • Step 36 — Introduction to XPath Expressions — Absolute and Relative
      • Step 37 — Using id and class in XPath Expressions
      • Step 38 — Using XPath on the Forms Page
      • Step 39 — A Review of XPath Expressions and CSS Selectors

      04 — Setting up First Web Application

      • Step 01 — Setting up First Web Application
      • Step 02 — Refactoring Shortcuts To Learn
      • Step 03 — My Favorite Shortcuts — Ctrl + 1 and Ctrl + Space

      05 — Selenium Automation — Locators

      • Step 01 — Introduction to the Section
      • Step 02 — Setting up New Project with TestNG
      • Step 03 01 — Selenium Locators — Locate Elements By Id and WebElement Interface
      • Step 03 02 — Exercise — Selenium Locators — Locate Elements By Id
      • Step 04 — Selenium Locators — Locate Elements By Name — Part 1
      • Step 05 — Selenium Locators — Locate Elements By Name — Part 2
      • Step 06 — Abstracting @BeforeTest and @AfterTest to common super class AbstractChromeWebDriverTest
      • Step 07 — Debugging Errors — Element Not Found Exception
      • Step 08 — Selenium Locators — Locate Elements By Tag Name
      • Step 09 — Finding Multiple Matching Elements with findElements
      • Step 10 — Finding Multiple Matching input Elements
      • Step 11 — Slowing Tests using sleep for visualizing
      • Step 12 — Automation Test for Entering UserId and Password and Logging in from Login Page
      • Step 13 — Exercise — Create Automation Test fo Login Static Page
      • Step 14 — Selenium Locators — Locate Elements By Link Text
      • Step 15 — Selenium Locators — Locate Elements By Partial Link Text
      • Step 16 — Selenium Locators — Locate Elements By Class
      • Step 17 — Exercise — Selenium Locators — Locate Elements By Class
      • Step 18 — Selenium Locators — Locate Table Element
      • Step 19 — Exercise — Selenium Locators — Locate and Click Table Element
      • Step 20 — Understanding CSS Selectors for Table Data — td
      • Step 21 — Using XPath Expressions to Locate Table Elements
      • Step 22 — Choosing among multiple Selenium Locator Options
      • Step 23 — Improving Performance By Caching WebElements
      • Step 24 — Conclusion

      06 — Selenium Automation — Playing with Form Elements

      • Step 01 — Introduction to Section
      • Step 02 — Reading and Setting values into Text Elements using Selenium Web Driver Interface
      • Step 03 — Reading and Setting values into TextArea Elements using Selenium Web Driver Interface
      • Step 04 — Reading value of CheckBox in Automation Tests
      • Step 05 — Setting value of CheckBox in Automation Tests
      • Step 06 — Creating Framework Utility Method for CheckBox in Automation Tests
      • Step 07 — Reading value of Radio Button in Automation Tests
      • Step 08 — Setting value of Radio Button in Automation Tests
      • Step 09 — Reading value of Select Box
      • Step 10 — Reading value of Multi Select Box
      • Step 11 — Setting value of Select Box in Automation Test
      • Step 12 — Conclusion

      07 — Selenium Automation — Advanced Testing Scenarios

      • Step 01 — Introduction and Setting up New Project with TestNG and Selenium
      • Step 02 — Reading CSS Styles
      • Step 03 — Exercise — Reading CSS Styles
      • Step 04 — Checking if an element is enabled using isEnabled and Exploring WebDriver Interface
      • Step 05 — More methods in WebDriver Interface — getAttribute, getLocation and getSize
      • Step 06 — Accessing Window Information using WebDriver manage window method
      • Step 07 — Window Navigation in Selenium Automation Test with WebDriver navigate method
      • Step 08 — Automation Testing Modal Windows using Sleep
      • Step 09 — Automation Testing Modal Windows with Implicit Wait
      • Step 10 01 — Automation Testing Modal Windows with Explicit Waits
      • Step 10 02 — Automation Testing Modal Windows with Explicit Waits — Events
      • Step 11 — Testing Alert Boxes with Selenium
      • Step 12 — Window Handles and Basics of Testing New Browser Window Launch
      • Step 13 — Finding the Handle of Newly Launched Window
      • Step 14 — Switching to Newly Launched Window
      • Step 15 — Writing Automation Tests for Frames
      • Step 16 — Taking Screenshot during Automation Test
      • Step 17 — Executing JavaScript Code in Selenium Test
      • Step 18 — Reviewing WebDriver Interface
      • Step 20 — Writing Automation Tests for Tables
      • Step 21 — Designing a basic framework for Tables
      • Step 22 — Using Actions Interface for Basic Actions with Keyboard and Mouse
      • Step 23 — More Actions Interface — Drag, Drop, Hold and Release

      08 — Introduction to Cross Browser Automation Testing

      • Step 01 — Introduction to Cross Browser Automation Testing
      • Step 02 — Setting up a New Project and Running Tests in Chrome and Firefox
      • Step 03 — Running Automation Tests in Other Browser — Safari, Internet Explorer and Edge
      • Step 04 — Running Headless Automation Test with PhanthomJS
      • Step 05 — Running Automation Tests with Chrome and Firefox Browsers in Headless mode
      • Step 06 — Designing Cross Browser Automation Test Framework — Part 1
      • Step 07 — Designing Cross Browser Automation Test Framework — Part 2

      09 — Data Driven Testing with Data Providers, CSV and Excel Spreadsheets

      Читать:
      Как заменить микрофон на наушниках

Похожие статьи