Sie sind auf Seite 1von 23

Automation Testing

Sharing
Let’s Test Our Apps! - http://bit.ly/at-sharing-uajy
How far you know about Testing?
When does Testing do?
Why need `Automation Testing`?
What knowledge do you need?
- Product Knowledge
- Flow of product
- How to test` from developer
- How to test the feature of the product that
the developer created. So you as QA do
not test the wrong place.
- Scenario Prepared
- You can write down a few scenario along
the flow of product and `How to test`.
Are you ready to ROCKS?
Main Recipes Other Recipes
- Ruby - Browser
- Programming Language - Firefox
- Selenium WebDriver - Text Editor
- That makes the browser can use for - Visual Studio Code
automation. - Terminal
- Cucumber + Gherkin - PowerShell
- Tools for testing apps and its dialect
- Web browser engine
- Geckodriver that is core of firefox
- Rspec
- DSL testing tool written in Ruby
Install Ruby
1. Download the latest ruby from
https://rubyinstaller.org/
2. Then open the installer to install.
3. Just next-and-next until done.
Final Touch for Ruby
1. Download latest geckodriver from
https://github.com/mozilla/geckodriver/releas
es
2. Extract and put it to folder [path_to_ruby]/bin
3. Make sure folder [path_to_ruby]/bin on your OS
environment.
On Windows check it on
System Properties > Advance System Settings >
Environment variables > System Variables > Path
Install Needed Packages with Gem
1. Gem is package manager for ruby. So it automatically installed when we install
Ruby.
2. Run this command on your terminal to install it.
a. $> gem install bundler
b. $> gem install selenium-webdriver
c. $> gem install cucumber
d. $> gem install rspec
3. If needed close and re-launch the terminal.
Installed? Let’s go further!
Initialization Playground
1. Create our playground folder. Name it
hmm… learn-testing maybe.
a. $ mkdir learn-testing
2. Enter your folder
a. $ cd learn-testing
3. Init the folder with Cucumber environment.
a. $ cucumber --init
4. See what cucumber create for us.
a. create features
b. create features/step_definitions
c. create features/support
d. create features/support/env.rb
Add commands
1. Open your project with your beloved text Fill steps.rb with:
editor. VSCode maybe.
require 'selenium-webdriver'
2. Create the files:
require 'rubygems'
a. test.feature on folder features
require 'rspec/expectations'
b. steps.rb on folder step_definitions
3. Fill the files: driver = Selenium::WebDriver.for :firefox

Fill test.feature with: Given("I Open the medium homepage") do


driver.navigate.to "https://medium.com/"
Feature: Check Medium Homepage end
Scenario:
Given I Open the medium homepage
See the magic
1. Back to terminal
and run it on
your playground
folder
a. $ cucumber
2. And then see
the magic!
Enough on earth. Let’s go to the SKY!
Advanced Case
1. Keep on your browser tabs Scenario:
a. https://docs.cucumber.io/gherkin/reference/
Feature: Check LMS
b. https://www.seleniumhq.org/docs/
c. https://github.com/SeleniumHQ/selenium/wiki
/Ruby-Bindings Scenario: Sign In LMS
Given I sign in LMS
2. Our first scenario in this section is:
Check LMS (Situs Kuliah UAJY)
3. So your can create new:
a. Scenario: lms.feature
b. Steps: lms_steps.rb
Steps
require 'selenium-webdriver' # Scenario: Sign In LMS
require 'rubygems' Given("I sign in LMS") do
require 'rspec/expectations' driver = Selenium::WebDriver.for :firefox,
desired_capabilities: capabilities
# Create new profile for Firefox
profile = Selenium::WebDriver::Firefox::Profile.new
profile.secure_ssl = true driver.get('https://kuliah.uajy.ac.id/login/index.php')
driver = driver.find_element(id: 'username').send_keys('npm')
Selenium::WebDriver::Firefox::Options#profile=profile driver.find_element(id:
'password').send_keys('password')
# Make firefox trust our web
capabilities = driver.find_element(id: 'loginbtn').click
Selenium::WebDriver::Remote::Capabilities.firefox(accep end
t_insecure_certs: true)
driver = ''
Advanced Case: Second Scenario
1. Clone this repo Scenario:
a. https://github.com/EkaJuliantara/
Feature: Check Evaluation Form
automation-testing-sharing
2. Then create automation
Scenario: Fill and Enter Form Evalution
testing for this evaluation form Given I Enter the form evaluation
a. http://bit.ly/2iKkWew
Then I Want to fill form on the first Page
Then I Want to fill form on the second Page
Then I Want to fill form on the third Page
Steps (Template)
require 'selenium-webdriver' #Scenario: Fill and Enter Form Evalution
require 'rubygems' Given("I Enter the form evaluation") do
require 'rspec/expectations' # ...
end
# Create new profile for Firefox Then("I Want to fill form on the first Page") do
profile = Selenium::WebDriver::Firefox::Profile.new # ...
profile.secure_ssl = true end
driver = Then("I Want to fill form on the second Page") do
Selenium::WebDriver::Firefox::Options#profile=profile # ...
end
# Make firefox trust our web Then("I Want to fill form on the third Page") do
capabilities = # ...
Selenium::WebDriver::Remote::Capabilities.firefox(accep end
t_insecure_certs: true)
driver = ''
Above the sky there is another sky
https://medium.com/binar-academy/review-katalon-kini-automated-
testing-semudah-membuat-mie-instan-7e9ab2d8a7c5
References
- https://www.slideshare.net/IbnuFajarYunardi/automation-zaman-
now?qid=ffbae416-2a5a-4740-b70f-c44ae76a3a0a&v=&b=&from_search=1
- https://medium.com/binar-academy/belajar-automation-selenium-installation-
setup-untuk-windows-caf6bd83d6c7
- http://www.multisoftsystems.com/blog/why-you-should-move-from-manual-
testing-to-automation-testing/
- https://docs.cucumber.io/gherkin/reference/
- https://www.seleniumhq.org/docs/
- https://github.com/EkaJuliantara/automation-testing-sharing
About Us
I Putu Eka Juliantara Verryanto Paulus

- Mail me: - Mail me:


juliantaraeka@gmail.com verryantopaulus@gmail.com
- Connect me: - Connect me:
https://www.linkedin.com/in/eka-juliantara https://www.linkedin.com/in/vrry/
Thank you
“In your thirst for knowledge, be sure not to drown in all the
information.” - Anthony J. D'Angelo

Das könnte Ihnen auch gefallen