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.
v1.0.4
BEFORE YOU USE WHALY
- need to install ruby interpreter
- following gem package need to install - selenium-webdriver
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
-pre-release
Note: maybe it's contains few bugs
In your bash,
alias whaly='bash whalys/whaly-runner.sh'
whaly <your text filename> [--options]
Example:
whaly google.txt --create
after you completely written it, just stop it ctrl + c
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
step 1: create empty file name as google.txt <br>
step 2: whaly google.txt --create <br>
step 3: whaly google.txt --run
@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
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
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 |
- anybody can use without any prior programming knowledge
- easy to use
copyright @ Suresh P | All rights reserved | MIT License |