How to solve this question?

You are a captain of a pirate ship, the Black Pearl. You are planning a trip around the Carribean, but you want to visit som particular types of places. There is a website with a simple search form that lists locations around. For example, it’s possible to list all islands in the area querying for word isla. Unfortunately, pirate internet uses ravens to carry messages around and getting response always takes 100 ms. The search results are listed as ⟨ li ⟩ elements nested directly under ⟨ul⟩ with id equal to search-results. The search is case insensitive. Write a list of test cases that should check whether given search form correctly. Write them as JUnit test methods (@Test) in Solution class. Before each test, your class is called with the WebDriver already pointing at the page being tested. You can play with the reference, fully working page here. Requirements: 1. Check if query input and submit button are on the main screen of the application: eequirements: 1. Check if query input and submit button are on the main screen of the application: - Search query input has id equal to search-input. - Submit button has id equal to search-button. 2. Check if searching with empty query is forbidden: - After trying to use an empty query, a div with id equal to error-empty-query. 3. Check if at least one islandisiretumedafter querying for isla: - There should be at least one <1i > result element. 4. Check if user getsifedback if thereareno results: - As there are no castles around, so querying for castle should return 0 resulis In this case, div with id equal to error-noresults. 5. Checkif resulf match the query: there is only one port around, Port Royal. querying for port should return only one result, Port Royal.

assesment/Tools:
You should use the CodilitySeliniumLibrary, which exposes the Open Test page keyword. The keyword opens the browser and loads the page being tested.

If the page being tested is misbehaving at least one of your tests should fails.

Search queries are case insensitive.

Search API response time is always 100ms.
Performance is not assessed, focus only on the correctness of the test.
Tests may take longer time due to the browser running in the background.

in Robot framework

You write a test case and then execute. After that you get a an execution report and log, where you can analyze the results.

Good luck!

1 Like

What do you expect as help ? Your question looks like https://codelity.com assessment - url in the code doesn’t look it has anything to do with the task itself and infact, it is essentially 404 and then you expect community to give you free consultation to get you pass the exams ?

3 Likes