Coder Social home page Coder Social logo

rudra's Introduction

rudra

Rudra: A Selenium IDE alternative using Ruby binding of selenium-webdriver.

Install

gem install rudra

How To Use

require 'rudra'

# Initailize using Chrome and zh-TW locale
rudra = Rudra.new browser: :chrome, locale: :zh_tw

# Initialize headless with 1920x1080 window size
rudra = Rudra.new headless: true, window_size: '1920,1080'

# Sample Steps
rudra.puts 'Search: webdriver'
rudra.open 'https://www.google.com'
rudra.puts 'Go to Google Search'
rudra.send_keys 'name=q', 'webdriver', :enter
rudra.puts 'Wait until page title contains: webdriver'
rudra.wait_for_title 'webdriver'
rudra.puts 'Scroll to footer'
rudra.scroll_into_view '#fbar'
rudra.puts 'Draw a redmark'
rudra.draw_redmark '#fsl'
rudra.puts 'Save a screenshot'
rudra.save_screenshot 'sample_screen'
rudra.puts 'Clear the drawing'
rudra.clear_drawings
rudra.puts 'Quit the driver'
rudra.quit

#
# Rudra supports Basic/Digest Authentication using a built-in Chrome extension
#
require 'rudra'

rudra = Rudra.new auth_username: 'guest', auth_password: 'guest'
rudra.puts 'Basic/Digest Authentication Test'
rudra.open 'https://jigsaw.w3.org/HTTP/Basic/' # Basic Authentication test
# rudra.open 'https://jigsaw.w3.org/HTTP/Digest/' # Digest Authentication test
rudra.save_screenshot 'Authentication Pass'
rudra.quit

Supported locator

Format: 'how=what'

  • css=.btn
  • class=btn-primary
  • id=frame1
  • name=j_username
  • xpath=//span/a
  • etc

If how is not specified, locator starting with / or ( will be parsed as xpath, while ., [ and # are treated as css.

css pseudo selector support => :eq()

Documentation

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.