All Projects → iamalittletester → thewaiter

iamalittletester / thewaiter

Licence: other
A Waiter library for Selenium tests

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to thewaiter

throughout
🎪 End-to-end testing made simple (using Jest and Puppeteer)
Stars: ✭ 16 (-69.23%)
Mutual labels:  selenium
selenium-client
A PHP Selenium client
Stars: ✭ 31 (-40.38%)
Mutual labels:  selenium
python-data-from-web
API and web scraping workshops
Stars: ✭ 32 (-38.46%)
Mutual labels:  selenium
python-crawler
爬虫学习仓库,适合零基础的人学习,对新手比较友好
Stars: ✭ 37 (-28.85%)
Mutual labels:  selenium
FUTpuppeteer
This is an auto-clicker bot used to trade players and items on FIFA Ultimate Team's Web App.
Stars: ✭ 11 (-78.85%)
Mutual labels:  selenium
InstaBot
Simple and friendly Bot for Instagram, using Selenium and Scrapy with Python.
Stars: ✭ 32 (-38.46%)
Mutual labels:  selenium
google-image-downloader
A script to download images from images.google.com
Stars: ✭ 28 (-46.15%)
Mutual labels:  selenium
pyderman
Install Selenium-compatible Chrome/Firefox/Opera/PhantomJS/Edge webdrivers automatically.
Stars: ✭ 24 (-53.85%)
Mutual labels:  selenium
weibo topic
微博话题关键词,个人微博采集, 微博博文一键删除 selenium获取cookie,requests处理
Stars: ✭ 28 (-46.15%)
Mutual labels:  selenium
webdriverio-zap-proxy
Demo - how to easily build security testing for Web App, using Zap and Glue
Stars: ✭ 58 (+11.54%)
Mutual labels:  selenium
selenium-java
This is the sample repository that we use in the Complete Selenium WebDriver with Java Bootcamp
Stars: ✭ 45 (-13.46%)
Mutual labels:  selenium
facebook-data-extraction
Experiences in extracting data from Facebook with these 3 methods: Facebook Graph API, Automation tools, DevTools Console
Stars: ✭ 81 (+55.77%)
Mutual labels:  selenium
Spider
Spider项目将会不断更新本人学习使用过的爬虫方法!!!
Stars: ✭ 16 (-69.23%)
Mutual labels:  selenium
devtools-proxy
Multiplexing proxy for Chrome DevTools. Fully compatible with Selenium and ChromeDriver
Stars: ✭ 64 (+23.08%)
Mutual labels:  selenium
YouTubeUploader
An automated, headless YouTube Uploader
Stars: ✭ 116 (+123.08%)
Mutual labels:  selenium
vaccipy
Automatische Impfterminbuchung für www.impfterminservice.de
Stars: ✭ 548 (+953.85%)
Mutual labels:  selenium
TwitPy
🕊TwitPy - Follow/Unfollow Automation
Stars: ✭ 92 (+76.92%)
Mutual labels:  selenium
testbench
Vaadin TestBench is a tool for automated user interface testing of Vaadin Framework applications.
Stars: ✭ 20 (-61.54%)
Mutual labels:  selenium
jdi-light
Powerful Framework for UI Automation Testing on Java
Stars: ✭ 84 (+61.54%)
Mutual labels:  selenium
nightwatch101
使用 Nightwatch 實現 End-to-End Testing ★
Stars: ✭ 42 (-19.23%)
Mutual labels:  selenium

thewaiter - A Waiter library for Selenium tests.

Travis CI: Build Status Javadoc: Javadocs

Purpose

The purpose for this library is to help write reliable Selenium tests by using WebDriverWait based methods to wait for a wide range of page events. It contains a class called Waiter, which holds all the wait based methods. Some examples of what you can wait for by using this library:

  • page load complete
  • URLs to load in browser, with variations: the URL to wait for equals, contains an expected String; ignores or cares about the case of the URL and expected String
  • opening a URL in the browser and waiting for: the page load complete, a URL to load or a webElement to be displayed
  • an element to become clickable and the actual click to happen
  • a WebElement's text: to equal or contain an expected String, taking into account or ignoring the case and whitespaces
  • a WebElement's attribute: to equal or contain an expected String, taking into account or ignoring the case and whitespaces
  • clicking on a WebElement and waiting for: a URL to load in the browser, which equals, contains or starts with a specified String, ignoring or taking into account the case
  • clicking on a WebElement and waiting for the page to load completely

New releases of the library will add even more useful wait methods.

Where to find the release versions

The library was uploaded to the official Maven repository and can be found here: https://mvnrepository.com/artifact/com.imalittletester/thewaiter

Importing into your test project

In order to import the library into your Maven project, in the <dependencies> section, add the following dependency:

 <dependency>
     <groupId>com.imalittletester</groupId>
     <artifactId>thewaiter</artifactId>
     <version>1.0</version>
     <exclusions>
            <exclusion>
                    <groupId>org.seleniumhq.selenium</groupId>
                    <artifactId>selenium-java</artifactId>
            </exclusion>
     </exclusions>
 </dependency>

The waiter library has Selenium as a dependency, so in order to avoid dependency management issues, the "exclusion" section needs to be added. This way, you can control from your own dependency the Selenium version you want to import into your project.

Using Waiter in your tests

After you imported the library as a dependency, you can start creating the tests that will use it. In the class where you will use it, you first need to import the Waiter class, as follows:

import waiter.Waiter;

Then, you need to instantiate it:

private Waiter waiter = new Waiter();

In the test itself, just call the method you need from the Waiter class. Some examples:

 waiter.get(theUrl, theDriverInstance);

 waiter.waitForElementTextEqualsString(webElement, expectedString, theDriverInstance);

 waiter.waitForElementAttributeContainsString(webElement, theAttribute, expectedString, theDriverInstance, 10);

 waiter.click(webElement, theDriverInstance);
 
 waiter.clickElementAndWaitForUrlContains(webElement, expectedString, theDriverInstance);

When the method you use from the library requires a WebElement to be passed to the method call, make sure you define the WebElement in a PageObject class, not as "driver.findElement()" directly in the method call, as the latter will not work.

Make sure to read the Javadoc of the methods you want to use: http://javadoc.io/doc/com.imalittletester/thewaiter.

Further reading

I will write some posts with examples of how to use the library on my blog (https://imalittletester.com/category/waiter/). There will also be test examples in another GitHub repo i am working on (https://github.com/iamalittletester/learning-project/tree/master/src/test/java/waitertests).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].