This commit is contained in:
Lukáš Kaňka 2023-10-17 11:00:26 +02:00
parent eeec5f17ca
commit 96bdd7322c
5 changed files with 2517 additions and 43 deletions

View File

@ -3,14 +3,19 @@ Library SeleniumLibrary
*** Variables ***
${search_text} books
@{search_text_list} book mobile travel robot gifts
#tímto do proměnné mohu zadat více hodnot, v testu pak text indexujeme jak 0 = záznam 1, 1 = 2 záznam. Začínáme nulou
#v testu už to zapíšeme místo @ s $
*** Keywords ***
Input Search Text and Click Search
input text //*[@id="gh-ac"] mobile
input text //*[@id="gh-ac"] ${search_text_list}[1]
press keys xpath://*[@id="gh-btn"] RETURN
# Pokročilé vyhledávání
Click on Advanced Search Link
CLICK ELEMENT //*[@id="gh-as-a"]
Search for another text
INPUT TEXT input text //*[@id="gh-ac"] ${search_text}

View File

@ -1,9 +1,15 @@
*** Settings ***
Library SeleniumLibrary
Resource ../../Resources/PageObjects/HeaderPage.robot
*** Variables ***
${search_result} výsledků
*** Keywords ***
# zde jsem si vytvořil proměnou na vyhledávání a připojím proměnou s HeaderPage
Verify Search Results
page should contain výsledků mobile
page should contain ${search_result} ${search_text_list}[1]
Select product condition

View File

@ -1806,31 +1806,31 @@ function stopPropagation(event) {
window.output = {};
</script>
<script type="text/javascript">
window.output["suite"] = [1,2,3,4,[],[1,0,16196],[],[[5,0,6,[7],[1,297,9379],[[1,8,9,0,0,0,0,0,[1,298,4375],[[0,10,11,0,12,13,0,0,[1,298,4234],[[299,2,14]]],[0,15,11,0,16,0,0,0,[1,4532,141],[]]]],[0,17,18,0,0,0,0,0,[1,4674,2747],[[0,19,11,0,20,21,0,0,[1,4674,120],[[4674,2,22]]],[0,23,11,0,24,25,0,0,[1,4794,2627],[[4795,2,26],[7287,2,27],[7287,2,28]]]]],[0,29,30,0,0,0,0,0,[1,7421,28],[[0,31,11,0,32,33,0,0,[1,7421,28],[[7449,2,34]]]]],[2,35,9,0,0,0,0,0,[1,7449,2226],[[0,36,11,0,37,0,0,0,[1,7449,2226],[]]]]]],[38,0,39,[7],[1,9676,6519],[[1,8,9,0,0,0,0,0,[1,9677,3371],[[0,10,11,0,12,13,0,0,[1,9677,3249],[[9677,2,14]]],[0,15,11,0,16,0,0,0,[1,12926,122],[]]]],[0,40,18,0,0,0,0,0,[1,13049,967],[[0,41,11,0,42,43,0,0,[1,13049,967],[[13049,2,44]]]]],[2,35,9,0,0,0,0,0,[1,14016,2179],[[0,36,11,0,37,0,0,0,[1,14017,2178],[]]]]]]],[],[2,2,0,0]];
window.output["suite"] = [1,2,3,4,[],[1,0,16148],[],[[5,0,6,[7],[1,269,9129],[[1,8,9,0,0,0,0,0,[1,270,3952],[[0,10,11,0,12,13,0,0,[1,270,3816],[[271,2,14]]],[0,15,11,0,16,0,0,0,[1,4087,135],[]]]],[0,17,18,0,0,0,0,0,[1,4222,2926],[[0,19,11,0,20,21,0,0,[1,4223,161],[[4224,2,22]]],[0,23,11,0,24,25,0,0,[1,4386,2762],[[4386,2,26],[6971,2,27],[6971,2,28]]]]],[0,29,30,0,0,0,0,0,[1,7149,37],[[0,31,11,0,32,33,0,0,[1,7149,37],[[7185,2,34]]]]],[2,35,9,0,0,0,0,0,[1,7186,2212],[[0,36,11,0,37,0,0,0,[1,7186,2212],[]]]]]],[38,0,39,[7],[1,9398,6749],[[1,8,9,0,0,0,0,0,[1,9400,3597],[[0,10,11,0,12,13,0,0,[1,9400,3468],[[9401,2,14]]],[0,15,11,0,16,0,0,0,[1,12868,129],[]]]],[0,40,18,0,0,0,0,0,[1,12998,940],[[0,41,11,0,42,43,0,0,[1,12998,940],[[12999,2,44]]]]],[2,35,9,0,0,0,0,0,[1,13939,2208],[[0,36,11,0,37,0,0,0,[1,13939,2208],[]]]]]]],[],[2,2,0,0]];
</script>
<script type="text/javascript">
window.output["strings"] = [];
</script>
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*Verify search functionality","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\Verify_search_functionality.robot","*../Tests/eBay/Verify_search_functionality.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search Functionality","*<p>This test case verifies the basic search\x3c/p>","*Functional","*Start test","*CommonFunctionality","*Open Browser","*SeleniumLibrary","*<p>Opens a new browser instance to the optional <code>url\x3c/code>.\x3c/p>","*${url}, ${browser}","*Opening browser 'chrome' to base url '<a href=\"https://www.ebay.com/\">https://www.ebay.com/\x3c/a>'.","*Maximize Browser Window","*<p>Maximizes current browser window.\x3c/p>","*Input Search Text and Click Search","*HeaderPage","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-ac\"], mobile","*Typing text 'mobile' into text field '//*[@id=\"gh-ac\"]'.","*Press Keys","*<p>Simulates the user pressing key(s) to an element or on the active browser.\x3c/p>","*<a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"], RETURN","*Sending key(s) ('RETURN',) to <a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"] element.","*Pressing special key RETURN to element.","*Releasing special key RETURN.","*Verify Search Results","*SearchResultsPage","*Page Should Contain","*<p>Verifies that current page contains <code>text\x3c/code>.\x3c/p>","*výsledků mobile","*Current page contains text 'výsledků mobile'.","*Finnish TestCase","*Close Browser","*<p>Closes the current browser.\x3c/p>","*Verify advenced search functionality","*<p>This test case verifies the advanced search\x3c/p>","*Click on Advanced Search Link","*Click Element","*<p>Click the element identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-as-a\"]","*Clicking element '//*[@id=\"gh-as-a\"]'.","*Error in file 'C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Resources\\PageObjects\\SearchResultsPage.robot' on line 8: Creating keyword 'Select product condition' failed: User keyword cannot be empty.","*Error in file 'C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Resources\\PageObjects\\SearchResultsPage.robot' on line 11: Creating keyword 'Select delivery options' failed: User keyword cannot be empty."]);
window.output["strings"] = window.output["strings"].concat(["*","*Verify search functionality","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Tests\\eBay\\Verify_search_functionality.robot","*../Tests/eBay/Verify_search_functionality.robot","*<p>Basic Search Funcianality\x3c/p>","*Verify basic search Functionality","*<p>This test case verifies the basic search\x3c/p>","*Functional","*Start test","*CommonFunctionality","*Open Browser","*SeleniumLibrary","*<p>Opens a new browser instance to the optional <code>url\x3c/code>.\x3c/p>","*${url}, ${browser}","*Opening browser 'chrome' to base url '<a href=\"https://www.ebay.com/\">https://www.ebay.com/\x3c/a>'.","*Maximize Browser Window","*<p>Maximizes current browser window.\x3c/p>","*Input Search Text and Click Search","*HeaderPage","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-ac\"], ${search_text_list}[1]","*Typing text 'mobile' into text field '//*[@id=\"gh-ac\"]'.","*Press Keys","*<p>Simulates the user pressing key(s) to an element or on the active browser.\x3c/p>","*<a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"], RETURN","*Sending key(s) ('RETURN',) to <a href=\"xpath://*[@id=&quot;gh-btn\">xpath://*[@id=\"gh-btn\x3c/a>\"] element.","*Pressing special key RETURN to element.","*Releasing special key RETURN.","*Verify Search Results","*SearchResultsPage","*Page Should Contain","*<p>Verifies that current page contains <code>text\x3c/code>.\x3c/p>","*${search_result}, ${search_text_list}[1]","*Current page contains text 'výsledků'.","*Finnish TestCase","*Close Browser","*<p>Closes the current browser.\x3c/p>","*Verify advenced search functionality","*<p>This test case verifies the advanced search\x3c/p>","*Click on Advanced Search Link","*Click Element","*<p>Click the element identified by <code>locator\x3c/code>.\x3c/p>","*//*[@id=\"gh-as-a\"]","*Clicking element '//*[@id=\"gh-as-a\"]'.","*Error in file 'C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Resources\\PageObjects\\SearchResultsPage.robot' on line 14: Creating keyword 'Select product condition' failed: User keyword cannot be empty.","*Error in file 'C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Mentor\\Resources\\PageObjects\\SearchResultsPage.robot' on line 17: Creating keyword 'Select delivery options' failed: User keyword cannot be empty."]);
</script>
<script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:00:16","fail":0,"label":"All Tests","pass":2,"skip":0}],[{"elapsed":"00:00:16","fail":0,"label":"Functional","pass":2,"skip":0}],[{"elapsed":"00:00:16","fail":0,"id":"s1","label":"Verify search functionality","name":"Verify search functionality","pass":2,"skip":0}]];
</script>
<script type="text/javascript">
window.output["errors"] = [[294,4,45],[295,4,46]];
window.output["errors"] = [[266,4,45],[266,4,46]];
</script>
<script type="text/javascript">
window.output["baseMillis"] = 1697492102399;
window.output["baseMillis"] = 1697525827162;
</script>
<script type="text/javascript">
window.output["generated"] = 16204;
window.output["generated"] = 16156;
</script>
<script type="text/javascript">
window.output["expand_keywords"] = null;
</script>
<script type="text/javascript">
window.settings = {"defaultLevel":"INFO","minLevel":"INFO","reportURL":"report.html","rpa":false,"splitLogBase":"log","title":""};
window.settings = {"defaultLevel":"INFO","minLevel":"INFO","reportURL":"obot.html","rpa":false,"splitLogBase":"log","title":""};
</script>
<title></title>
</head>

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231016 23:35:02.397" rpa="false" schemaversion="4">
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231017 08:57:07.159" rpa="false" schemaversion="4">
<suite id="s1" name="Verify search functionality" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Tests\eBay\Verify_search_functionality.robot">
<test id="s1-t1" name="Verify basic search Functionality" line="17">
<kw name="Start test" library="CommonFunctionality" type="SETUP">
@ -7,53 +7,54 @@
<arg>${url}</arg>
<arg>${browser}</arg>
<doc>Opens a new browser instance to the optional ``url``.</doc>
<msg timestamp="20231016 23:35:02.698" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg>
<status status="PASS" starttime="20231016 23:35:02.697" endtime="20231016 23:35:06.931"/>
<msg timestamp="20231017 08:57:07.433" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg>
<status status="PASS" starttime="20231017 08:57:07.432" endtime="20231017 08:57:11.248"/>
</kw>
<kw name="Maximize Browser Window" library="SeleniumLibrary">
<doc>Maximizes current browser window.</doc>
<status status="PASS" starttime="20231016 23:35:06.931" endtime="20231016 23:35:07.072"/>
<status status="PASS" starttime="20231017 08:57:11.249" endtime="20231017 08:57:11.384"/>
</kw>
<status status="PASS" starttime="20231016 23:35:02.697" endtime="20231016 23:35:07.072"/>
<status status="PASS" starttime="20231017 08:57:07.432" endtime="20231017 08:57:11.384"/>
</kw>
<kw name="Input Search Text and Click Search" library="HeaderPage">
<kw name="Input Text" library="SeleniumLibrary">
<arg>//*[@id="gh-ac"]</arg>
<arg>mobile</arg>
<arg>${search_text_list}[1]</arg>
<doc>Types the given ``text`` into the text field identified by ``locator``.</doc>
<msg timestamp="20231016 23:35:07.073" level="INFO">Typing text 'mobile' into text field '//*[@id="gh-ac"]'.</msg>
<status status="PASS" starttime="20231016 23:35:07.073" endtime="20231016 23:35:07.193"/>
<msg timestamp="20231017 08:57:11.386" level="INFO">Typing text 'mobile' into text field '//*[@id="gh-ac"]'.</msg>
<status status="PASS" starttime="20231017 08:57:11.385" endtime="20231017 08:57:11.546"/>
</kw>
<kw name="Press Keys" library="SeleniumLibrary">
<arg>xpath://*[@id="gh-btn"]</arg>
<arg>RETURN</arg>
<doc>Simulates the user pressing key(s) to an element or on the active browser.</doc>
<msg timestamp="20231016 23:35:07.194" level="INFO">Sending key(s) ('RETURN',) to xpath://*[@id="gh-btn"] element.</msg>
<msg timestamp="20231016 23:35:09.686" level="INFO">Pressing special key RETURN to element.</msg>
<msg timestamp="20231016 23:35:09.686" level="INFO">Releasing special key RETURN.</msg>
<status status="PASS" starttime="20231016 23:35:07.193" endtime="20231016 23:35:09.820"/>
<msg timestamp="20231017 08:57:11.548" level="INFO">Sending key(s) ('RETURN',) to xpath://*[@id="gh-btn"] element.</msg>
<msg timestamp="20231017 08:57:14.133" level="INFO">Pressing special key RETURN to element.</msg>
<msg timestamp="20231017 08:57:14.133" level="INFO">Releasing special key RETURN.</msg>
<status status="PASS" starttime="20231017 08:57:11.548" endtime="20231017 08:57:14.310"/>
</kw>
<status status="PASS" starttime="20231016 23:35:07.073" endtime="20231016 23:35:09.820"/>
<status status="PASS" starttime="20231017 08:57:11.384" endtime="20231017 08:57:14.310"/>
</kw>
<kw name="Verify Search Results" library="SearchResultsPage">
<kw name="Page Should Contain" library="SeleniumLibrary">
<arg>výsledků mobile</arg>
<arg>${search_result}</arg>
<arg>${search_text_list}[1]</arg>
<doc>Verifies that current page contains ``text``.</doc>
<msg timestamp="20231016 23:35:09.848" level="INFO">Current page contains text 'výsledků mobile'.</msg>
<status status="PASS" starttime="20231016 23:35:09.820" endtime="20231016 23:35:09.848"/>
<msg timestamp="20231017 08:57:14.347" level="INFO">Current page contains text 'výsledků'.</msg>
<status status="PASS" starttime="20231017 08:57:14.311" endtime="20231017 08:57:14.348"/>
</kw>
<status status="PASS" starttime="20231016 23:35:09.820" endtime="20231016 23:35:09.848"/>
<status status="PASS" starttime="20231017 08:57:14.311" endtime="20231017 08:57:14.348"/>
</kw>
<kw name="Finnish TestCase" library="CommonFunctionality" type="TEARDOWN">
<kw name="Close Browser" library="SeleniumLibrary">
<doc>Closes the current browser.</doc>
<status status="PASS" starttime="20231016 23:35:09.848" endtime="20231016 23:35:12.074"/>
<status status="PASS" starttime="20231017 08:57:14.348" endtime="20231017 08:57:16.560"/>
</kw>
<status status="PASS" starttime="20231016 23:35:09.848" endtime="20231016 23:35:12.074"/>
<status status="PASS" starttime="20231017 08:57:14.348" endtime="20231017 08:57:16.560"/>
</kw>
<doc>This test case verifies the basic search</doc>
<tag>Functional</tag>
<status status="PASS" starttime="20231016 23:35:02.696" endtime="20231016 23:35:12.075"/>
<status status="PASS" starttime="20231017 08:57:07.431" endtime="20231017 08:57:16.560"/>
</test>
<test id="s1-t2" name="Verify advenced search functionality" line="24">
<kw name="Start test" library="CommonFunctionality" type="SETUP">
@ -61,37 +62,37 @@
<arg>${url}</arg>
<arg>${browser}</arg>
<doc>Opens a new browser instance to the optional ``url``.</doc>
<msg timestamp="20231016 23:35:12.076" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg>
<status status="PASS" starttime="20231016 23:35:12.076" endtime="20231016 23:35:15.325"/>
<msg timestamp="20231017 08:57:16.563" level="INFO">Opening browser 'chrome' to base url 'https://www.ebay.com/'.</msg>
<status status="PASS" starttime="20231017 08:57:16.562" endtime="20231017 08:57:20.030"/>
</kw>
<kw name="Maximize Browser Window" library="SeleniumLibrary">
<doc>Maximizes current browser window.</doc>
<status status="PASS" starttime="20231016 23:35:15.325" endtime="20231016 23:35:15.447"/>
<status status="PASS" starttime="20231017 08:57:20.030" endtime="20231017 08:57:20.159"/>
</kw>
<status status="PASS" starttime="20231016 23:35:12.076" endtime="20231016 23:35:15.447"/>
<status status="PASS" starttime="20231017 08:57:16.562" endtime="20231017 08:57:20.159"/>
</kw>
<kw name="Click on Advanced Search Link" library="HeaderPage">
<kw name="Click Element" library="SeleniumLibrary">
<arg>//*[@id="gh-as-a"]</arg>
<doc>Click the element identified by ``locator``.</doc>
<msg timestamp="20231016 23:35:15.448" level="INFO">Clicking element '//*[@id="gh-as-a"]'.</msg>
<status status="PASS" starttime="20231016 23:35:15.448" endtime="20231016 23:35:16.415"/>
<msg timestamp="20231017 08:57:20.161" level="INFO">Clicking element '//*[@id="gh-as-a"]'.</msg>
<status status="PASS" starttime="20231017 08:57:20.160" endtime="20231017 08:57:21.100"/>
</kw>
<status status="PASS" starttime="20231016 23:35:15.448" endtime="20231016 23:35:16.415"/>
<status status="PASS" starttime="20231017 08:57:20.160" endtime="20231017 08:57:21.100"/>
</kw>
<kw name="Finnish TestCase" library="CommonFunctionality" type="TEARDOWN">
<kw name="Close Browser" library="SeleniumLibrary">
<doc>Closes the current browser.</doc>
<status status="PASS" starttime="20231016 23:35:16.416" endtime="20231016 23:35:18.594"/>
<status status="PASS" starttime="20231017 08:57:21.101" endtime="20231017 08:57:23.309"/>
</kw>
<status status="PASS" starttime="20231016 23:35:16.415" endtime="20231016 23:35:18.594"/>
<status status="PASS" starttime="20231017 08:57:21.101" endtime="20231017 08:57:23.309"/>
</kw>
<doc>This test case verifies the advanced search</doc>
<tag>Functional</tag>
<status status="PASS" starttime="20231016 23:35:12.075" endtime="20231016 23:35:18.594"/>
<status status="PASS" starttime="20231017 08:57:16.560" endtime="20231017 08:57:23.309"/>
</test>
<doc>Basic Search Funcianality</doc>
<status status="PASS" starttime="20231016 23:35:02.399" endtime="20231016 23:35:18.595"/>
<status status="PASS" starttime="20231017 08:57:07.162" endtime="20231017 08:57:23.310"/>
</suite>
<statistics>
<total>
@ -105,7 +106,7 @@
</suite>
</statistics>
<errors>
<msg timestamp="20231016 23:35:02.693" level="ERROR">Error in file 'C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Resources\PageObjects\SearchResultsPage.robot' on line 8: Creating keyword 'Select product condition' failed: User keyword cannot be empty.</msg>
<msg timestamp="20231016 23:35:02.694" level="ERROR">Error in file 'C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Resources\PageObjects\SearchResultsPage.robot' on line 11: Creating keyword 'Select delivery options' failed: User keyword cannot be empty.</msg>
<msg timestamp="20231017 08:57:07.428" level="ERROR">Error in file 'C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Resources\PageObjects\SearchResultsPage.robot' on line 14: Creating keyword 'Select product condition' failed: User keyword cannot be empty.</msg>
<msg timestamp="20231017 08:57:07.428" level="ERROR">Error in file 'C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Resources\PageObjects\SearchResultsPage.robot' on line 17: Creating keyword 'Select delivery options' failed: User keyword cannot be empty.</msg>
</errors>
</robot>