Skip to content

sureshpandiyan1/whaly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 

Repository files navigation



GitHub stars GitHub forks GitHub issues GitHub tag (latest by date) GitHub Gem Version

Description

whaly is the easy way to write a browser-based selenium scripts.It's fully focused on the words, because words better than codes.it's written in ruby language.it's only compatible for linux platform.

pre-release version

v1.0.4

Pre-requisite

BEFORE YOU USE WHALY

- need to install ruby interpreter
- following gem package need to install - selenium-webdriver 

you can install via gem & guidelines how to use whaly gem

gem install whaly

## guidelines for ruby users

step1: create a your own empty filename, Example: 'test_google.txt'
step2: create a new .rb file, Example: 'whaly-file.rb'
    require 'whaly'
    
    my_whaly = Whaly.new()
    my_whaly.whaly_s('test_google.txt')
   
 step3:  run whaly-file.rb in your terminal, Example: whaly-file.rb
 
 "whaly engine is running until you press ctrl + c to stop"
 
 step4: you are ready to write whaly codes in demo.txt, 
        it will convert to selenium code in whalytest_test_google.txt.rb
        
 if you want to stop the whaly-engine, just press ctrl + c at terminal for stop

Phase

-pre-release

Note: maybe it's contains few bugs

highlights

  • you can write words instead of codes
  • runs smoothly without delay
  • builtin ruby
  • easy to use

how to setup ?

In your bash,
alias whaly='bash whalys/whaly-runner.sh'

how to run ?

whaly <your text filename> [--options]

Example:
    whaly google.txt --create

demo (windows/bash)

whaly_demos_edit_0.webm

whaly automatically write a selenium based by whaly

whaly_dd_edit_0_edit_4

after you completely written it, just stop it ctrl + c

list of all valid whaly - pre-release

if you write this in whaly produce
@import - whaly-engine require 'selenium-webdriver'
whaly-start-engine c driver = Selenium::WebDriver.for(:chrome)
go to the url "https://www.google.com" driver.navigate.to('https://www.google.com')
find name is 'q' .click driver.find_element(:name, 'q' ).click
delay-for 0.2 sleep 0.2
select name isz 'animals' and select-by - value - 'dog' Selenium::WebDriver::Support::Select.new(driver.find_element(:name, 'animals' )).select_by( value , 'dog')
stop-whaly-engine -quit driver.quit
add-cookies { name: 'hello' , value: 'howareyou' , same_site: 'Strict'} driver.manage.add_cookie(name: 'hello',value: 'howareyou',same_site: 'Strict')
show l-all-cookies driver.manage.all_cookies
show -Scookies - 'foo' driver.manage.cookie_named('foo')
del -Dcookies - 'foo' driver.manage.delete_all_cookies('foo')
del d-all-cookies driver.manage.delete_all_cookies
I/O keyboard key-up:(shift).send-keys(4,2).key-down.('how are you').send-keys(:shift).perform driver.action.key-up:(shift).send-keys(4,2).key-down.('how are you').send-keys(:shift).perform
<-- button driver.navigate.back
--> button driver.navigate.forward
just refresh!! driver.navigate.refresh
whaly-start-engine 
c for chrome
f for firefox
i for ie

Try this Example below:

step 1: create empty file name as google.txt <br>
step 2: whaly google.txt --create <br>
step 3: whaly google.txt --run

google.txt

@import - whaly-engine

start-whaly-engine c

go to the url 'https://www.google.com'

delay-for 3
find name is 'q'.send_keys('how are you man')
find xpath is '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[4]/center/input[1]'.click

delay-for 2
stop-whaly-engine -quit

output:

this file automatically located at whalytest-scripts/whalytest_demo.txt.rb

directory

require 'selenium-webdriver'

driver = Selenium::WebDriver.for(:chrome)

driver.navigate.to('https://www.google.com')
sleep 3
driver.find_element(:name, 'q').send_keys('how are you man')
driver.find_element(:xpath, '/html/body/div[1]/div[3]/form/div[1]/div[1]/div[4]/center/input[1]').click

sleep 2
driver.quit

code comparsion

code_comparsion

list of whaly shell commands (not for ruby gems)

arguments definition
--run complier the file continously
whaly [your filename] --run
--create create a file format to ruby
whaly [filename] --create
--about about whaly
whaly --about

main focus of whaly

- anybody can use without any prior programming knowledge
- easy to use

copyright & license

copyright @ Suresh P | All rights reserved | MIT License