top of page
hand-businesswoman-touching-hand-artificial-intelligence-meaning-technology-connection-go-
  • Sanya

Gherkin Script for validating data from a Scraping tool

I Scrape Blog data from Numpy Ninja – Manually



Feature 1: Using a web scraping tool

In order to scrape blog data from https://www.numpyninja.com/

As a user

I want to use the tool to extract the required data

Scenario 1: Log on to Numpy Ninja website for data scraping

Given I am on the Scraper tool home screen

When I enter https://www.numpyninja.com/ in the URL field

And I click on start button

Then Numpy Ninja homepage https://www.numpyninja.com/ should be loaded

Scenario 2: Loading the Blog webpage with many blogs

Given I am on the Scraper tool home screen

When I enter https://www.numpyninja.com/blog

And I click on start button

Then Numpy Ninja Blog webpage https://www.numpyninja.com/blog should be loaded

Scenario 3: Loading a particular Blog webpage

Given I am on the Scraper tool home screen

When I enter https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

And I click on start button

Then Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios should be loaded

Scenario 4: Capture the Title of the blog

Given I am on the Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

When I click on the Title

Then show “Data Scraping – Octoparse 8 with data driven scenarios”

Scenario 5: Capture the Author of the blog

Given I am on the Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

When I click on the Author

Then show “kspkalyani”

Scenario 6: Capture the Published_Time of the blog

Given I am on the Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

When I click on the Published_Time

Then show “3 hours ago”

Scenario 7: Capture the Time_to_Read of the blog

Given I am on the Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

When I click on the Time_to_Read

Then show “2 min read”

Scenario 8: Capture the Views of the blog

Given I am on the Numpy Ninja Blog webpage https://www.numpyninja.com/post/data-scraping-octoparse-8-with-data-driven-scenarios

When I click on the Views

Then show “7 views”


II Scrape price of MacBook Pro 2020 from Amazon – Auto-detect mode



Feature 1: Using a web scraping tool

In order to scrape price data of MacBook Pro 2020 from www.amazon.com

As a user

I want to use the tool to extract the required data

Scenario 1: Log on to amazon website for data scraping

Given I enter www.amazon.com in the URL field

When I click on start button

Then Amazon homepage should be loaded

Scenario 2: Loading “MacBook Pro 2020” related data webpage from homepage

Given I am on Amazon homepage

When I type MacBook Pro 2020 in the search bar

And click on search button

Then https://www.amazon.com/s?k=macbook+pro+2020&crid=K9QUCS3G2YEC&sprefix=macbook+pro+202%2Caps%2C228&ref=nb_sb_ss_ts-doa-p_3_15 webpage should get loaded

Scenario 3: Loading “MacBook Pro 2020” related data webpage directly

Given I enter https://www.amazon.com/s?k=macbook+pro+2020&crid=K9QUCS3G2YEC&sprefix=macbook+pro+202%2Caps%2C228&ref=nb_sb_ss_ts-doa-p_3_15 in the URL field

When I click on start button

Then https://www.amazon.com/sk=macbook+pro+2020&crid=K9QUCS3G2YEC&sprefix=macbook+pro+202%2Caps%2C228&ref=nb_sb_ss_ts-doa-p_3_15 webpage should get loaded

Scenario 4: Detect % web page data being loaded

Given I clicked start button

When the Amazon website is being loaded

Then a modal window should detect % web page data being loaded for infinite scroll

Scenario 5: Amazon website not getting loaded

Given I clicked start button

When the Amazon website is NOT being loaded

Then toggle browse button

And click Reload webpage

Scenario 6: Wrong webpage detected

Given I wrongly typed item in the search bar

When I click start button

Then I am not in the right page to extract required data

Scenario 7: Wrong webpage detected

Given I am not in the right page to extract required data

When I click on “Not the right webpage”

Then I can correct the wrongly typed item in the search bar


Feature 2: Validating the pre-selected elements by the tool

In order to validate the auto-detected data

As a user

I want to use the modal window

Scenario 1: To check auto detect is completed

Given I am on the home screen of the tool

When the Amazon website has finished loading in the built-in browser

Then modal window should show the message “Auto-detect completed”

Scenario 2: Detect the Title of the laptop

Given I am on https://www.amazon.com/Apple-MacBook-13-inch-256GB-Storage/dp/B08N5N6RSS/ref=sr_1_1_sspa?crid=K9QUCS3G2YEC&dchild=1&keywords=macbook+pro+2020&qid=1618592165&sprefix=macbook+pro+202%2Caps%2C228&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExUTRDRzlSSEtBN0VQJmVuY3J5cHRlZElkPUEwMzg4NDg1MzZIUTdUUEhQM1NURiZlbmNyeXB0ZWRBZElkPUEwNTY1MjQzMlJNTDgzVDJJWk9WViZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU= webpage

When detecting Title

Then show New Apple MacBook Pro with Apple M1 Chip (13-inch, 8GB RAM, 256GB SSD Storage) - Space Gray (Latest Model)

Scenario 3: Detect the Original Price of the laptop

Given I am on https://www.amazon.com/Apple-MacBook-13-inch-256GB-Storage/dp/B08N5N6RSS/ref=sr_1_1_sspa?crid=K9QUCS3G2YEC&dchild=1&keywords=macbook+pro+2020&qid=1618592165&sprefix=macbook+pro+202%2Caps%2C228&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExUTRDRzlSSEtBN0VQJmVuY3J5cHRlZElkPUEwMzg4NDg1MzZIUTdUUEhQM1NURiZlbmNyeXB0ZWRBZElkPUEwNTY1MjQzMlJNTDgzVDJJWk9WViZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU= webpage

When detecting Original Price

Then show $1,299.00

Scenario 4: Detect the Offer Price of the laptop

Given I am on https://www.amazon.com/Apple-MacBook-13-inch-256GB-Storage/dp/B08N5N6RSS/ref=sr_1_1_sspa?crid=K9QUCS3G2YEC&dchild=1&keywords=macbook+pro+2020&qid=1618592165&sprefix=macbook+pro+202%2Caps%2C228&sr=8-1-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUExUTRDRzlSSEtBN0VQJmVuY3J5cHRlZElkPUEwMzg4NDg1MzZIUTdUUEhQM1NURiZlbmNyeXB0ZWRBZElkPUEwNTY1MjQzMlJNTDgzVDJJWk9WViZ3aWRnZXROYW1lPXNwX2F0ZiZhY3Rpb249Y2xpY2tSZWRpcmVjdCZkb05vdExvZ0NsaWNrPXRydWU= webpage

When detecting Offer Price

Then show $1,199.00

Scenario 5: Detect the blank Original Price of the laptop

Given I am on https://www.amazon.com/s?k=macbook+pro+2020&crid=K9QUCS3G2YEC&sprefix=macbook+pro+202%2Caps%2C228&ref=nb_sb_ss_ts-doa-p_3_15 webpage

When Original Price detected is blank

Then show blank field

Scenario 6: Detect the blank Offer Price of the laptop

Given I am on https://www.amazon.com/s?k=macbook+pro+2020&crid=K9QUCS3G2YEC&sprefix=macbook+pro+202%2Caps%2C228&ref=nb_sb_ss_ts-doa-p_3_15 webpage

When Offer Price detected is blank

Then show blank field

286 views0 comments

Recent Posts

See All
bottom of page