Test Google

This commit is contained in:
Lukáš Kaňka 2023-10-14 09:28:27 +02:00
parent f0d30941ed
commit bb725fcd4c
20 changed files with 4864 additions and 41 deletions

3
RobotSelenium/Mentor/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
# Default ignored files
/shelf/
/workspace.xml

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.11 (Mentor)" project-jdk-type="Python SDK" />
</project>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/Mentor.iml" filepath="$PROJECT_DIR$/.idea/Mentor.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
</component>
</project>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231014 00:31:29.419" rpa="false" schemaversion="4">
<suite id="s1" name="GoogleSearch" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Mentor\Tests\Google\FunctionalTestSuite\GoogleSearch.robot">
<test id="s1-t1" name="This is sample test case" line="9">
<kw name="Open Browser" library="SeleniumLibrary">
<arg>${url}</arg>
<arg>${browser}</arg>
<doc>Opens a new browser instance to the optional ``url``.</doc>
<msg timestamp="20231014 00:31:29.915" level="INFO">Opening browser 'chrome' to base url 'https://www.google.com/'.</msg>
<status status="PASS" starttime="20231014 00:31:29.915" endtime="20231014 00:31:35.834"/>
</kw>
<kw name="Close Browser" library="SeleniumLibrary">
<doc>Closes the current browser.</doc>
<status status="PASS" starttime="20231014 00:31:35.835" endtime="20231014 00:31:38.141"/>
</kw>
<doc>Google test</doc>
<tag>regression</tag>
<status status="PASS" starttime="20231014 00:31:29.912" endtime="20231014 00:31:38.143"/>
</test>
<status status="PASS" starttime="20231014 00:31:29.427" endtime="20231014 00:31:38.145"/>
</suite>
<statistics>
<total>
<stat pass="1" fail="0" skip="0">All Tests</stat>
</total>
<tag>
<stat pass="1" fail="0" skip="0">regression</stat>
</tag>
<suite>
<stat pass="1" fail="0" skip="0" id="s1" name="GoogleSearch">GoogleSearch</stat>
</suite>
</statistics>
<errors>
</errors>
</robot>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,15 @@
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${browser} chrome
${url} https://www.google.com/
*** Test Cases ***
This is sample test case
[documentation] Google test
[tags] regression
open browser ${url} ${browser}
close browser
*** Keywords ***
# pro slova můžem vytvořit samostatný soubor

View File

@ -0,0 +1,27 @@
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${browser} chrome
${url} https://demo.nopcommerce.com/
*** Test Cases ***
TestingInputBox
open browser ${url} ${browser}
maximize browser window
# komtrola viditelnosti titulku
title should be nopCommerce demo store
click link xpath://a[@class="ico-login"]
${"email_txt"} set variable id:Email
# zadaný email je vidět
element should be visible ${"email_txt"}
# email je povolený
element should be enabled ${"email_txt"}
# vyplníme proměnou email
input text ${"email_txt"} superborec@gmail.com
# počkáme 5 sekund
sleep 5
# vymažeme email
clear element text ${"email_txt"}
sleep 3
close browser
*** Keywords ***

View File

@ -0,0 +1,8 @@
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${browser} chrome
# web už je nefunkční
${url} https://www.practiceselenium.com/practice-form.html
# test na zaškrtávací políčka

View File

@ -1,17 +1,22 @@
*** Settings ***
Library SeleniumLibrary
Test Timeout 2 minute
*** Variables ***
${browser} chrome
${url} https://demo.nopcommerce.com/
*** Test Cases ***
LoginTest
open browser https://demo.nopcommerce.com/ chrome
click link xpath://a[@class="ico-login"]
input text id:Email testing@gmail.com
input text id:Password Test@123
click element xpath://input[@class='button-1 Login-button']
open browser ${url} ${browser}
loginToApplication
close browser
*** Keywords ***
loginToApplication
click link xpath://a[@class="ico-login"]
input text id:Email testing@gmail.com
input text id:Password Test@123
click element xpath://button[@class='button-1 login-button']

View File

@ -1806,25 +1806,25 @@ function stopPropagation(event) {
window.output = {};
</script>
<script type="text/javascript">
window.output["suite"] = [1,2,3,0,[],[0,0,2927],[],[[4,0,0,[],[0,181,2745,5],[[0,6,7,0,8,9,0,0,[1,182,2568],[[183,2,10]]],[0,11,7,0,12,13,0,0,[0,2751,173],[[2752,2,14],[2921,2,15],[2921,5,5]]],[0,16,7,0,17,18,0,0,[3,2925,0],[]],[0,16,7,0,17,19,0,0,[3,2925,0],[]],[0,20,7,0,21,22,0,0,[3,2925,0],[]],[0,23,7,0,24,0,0,0,[3,2926,0],[]]]]],[],[1,0,1,0]];
window.output["suite"] = [1,2,3,0,[],[1,0,22192],[],[[4,0,0,[],[1,426,21764],[[0,5,6,0,7,8,0,0,[1,427,9655],[[428,2,9]]],[0,10,6,0,11,0,0,0,[1,10083,141],[]],[0,12,6,0,13,14,0,0,[1,10225,18],[[10243,2,15]]],[0,16,6,0,17,18,0,0,[1,10244,1061],[[10246,2,19]]],[0,20,21,0,22,23,24,0,[1,11307,0],[[11307,2,25]]],[0,26,6,0,27,24,0,0,[1,11308,61],[[11369,2,28]]],[0,29,6,0,30,24,0,0,[1,11370,90],[]],[0,31,6,0,32,33,0,0,[1,11461,190],[[11462,2,34]]],[0,35,21,0,36,37,0,0,[1,11652,5001],[[16653,2,38]]],[0,39,6,0,40,24,0,0,[1,16653,77],[]],[0,35,21,0,36,41,0,0,[1,16731,3001],[[19732,2,42]]],[0,43,6,0,44,0,0,0,[1,19732,2457],[]]]]],[],[1,1,0,0]];
</script>
<script type="text/javascript">
window.output["strings"] = [];
</script>
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*TC1","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Techie\\TestCases\\TC1.robot","*TestCases/TC1.robot","*LoginTest","*Link with locator '<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]' not found.","*Open Browser","*SeleniumLibrary","*<p>Opens a new browser instance to the optional <code>url\x3c/code>.\x3c/p>","*<a href=\"https://demo.nopcommerce.com/\">https://demo.nopcommerce.com/\x3c/a>, chrome","*Opening browser 'chrome' to base url '<a href=\"https://demo.nopcommerce.com/\">https://demo.nopcommerce.com/\x3c/a>'.","*Click Link","*<p>Clicks a link identified by <code>locator\x3c/code>.\x3c/p>","*<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]","*Clicking link '<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]'.","*\x3c/td>\x3c/tr><tr><td colspan=\"3\"><a href=\"selenium-screenshot-4.png\"><img src=\"selenium-screenshot-4.png\" width=\"800px\">\x3c/a>","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*id:Email testing@gmail.com","*id:Password Test@123","*Click Element","*<p>Click the element identified by <code>locator\x3c/code>.\x3c/p>","*<a href=\"xpath://input[@class='button-1\">xpath://input[@class='button-1\x3c/a> Login-button']","*Close Browser","*<p>Closes the current browser.\x3c/p>"]);
window.output["strings"] = window.output["strings"].concat(["*","*Inputbox","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Techie\\TestCases\\Inputbox.robot","*TestCases/Inputbox.robot","*TestingInputBox","*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://demo.nopcommerce.com/\">https://demo.nopcommerce.com/\x3c/a>'.","*Maximize Browser Window","*<p>Maximizes current browser window.\x3c/p>","*Title Should Be","*<p>Verifies that the current page title equals <code>title\x3c/code>.\x3c/p>","*nopCommerce demo store","*Page title is 'nopCommerce demo store'.","*Click Link","*<p>Clicks a link identified by <code>locator\x3c/code>.\x3c/p>","*<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]","*Clicking link '<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]'.","*Set Variable","*BuiltIn","*<p>Returns the given values which can then be assigned to a variables.\x3c/p>","*id:Email","*${\"email_txt\"}","*${\"email_txt\"} = id:Email","*Element Should Be Visible","*<p>Verifies that the element identified by <code>locator\x3c/code> is visible.\x3c/p>","*Element 'id:Email' is displayed.","*Element Should Be Enabled","*<p>Verifies that element identified by <code>locator\x3c/code> is enabled.\x3c/p>","*Input Text","*<p>Types the given <code>text\x3c/code> into the text field identified by <code>locator\x3c/code>.\x3c/p>","*${\"email_txt\"}, superborec@gmail.com","*Typing text 'superborec@gmail.com' into text field 'id:Email'.","*Sleep","*<p>Pauses the test executed for the given time.\x3c/p>","*5","*Slept 5 seconds","*Clear Element Text","*<p>Clears the value of the text-input-element identified by <code>locator\x3c/code>.\x3c/p>","*3","*Slept 3 seconds","*Close Browser","*<p>Closes the current browser.\x3c/p>"]);
</script>
<script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:00:03","fail":1,"label":"All Tests","pass":0,"skip":0}],[],[{"elapsed":"00:00:03","fail":1,"id":"s1","label":"TC1","name":"TC1","pass":0,"skip":0}]];
window.output["stats"] = [[{"elapsed":"00:00:22","fail":0,"label":"All Tests","pass":1,"skip":0}],[],[{"elapsed":"00:00:22","fail":0,"id":"s1","label":"Inputbox","name":"Inputbox","pass":1,"skip":0}]];
</script>
<script type="text/javascript">
window.output["errors"] = [];
</script>
<script type="text/javascript">
window.output["baseMillis"] = 1697200274427;
window.output["baseMillis"] = 1697232114719;
</script>
<script type="text/javascript">
window.output["generated"] = 2934;
window.output["generated"] = 22204;
</script>
<script type="text/javascript">
window.output["expand_keywords"] = null;

View File

@ -1,53 +1,88 @@
<?xml version="1.0" encoding="UTF-8"?>
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231013 14:31:14.425" rpa="false" schemaversion="4">
<suite id="s1" name="TC1" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Techie\TestCases\TC1.robot">
<test id="s1-t1" name="LoginTest" line="9">
<robot generator="Robot 6.1.1 (Python 3.11.4 on win32)" generated="20231013 23:21:54.715" rpa="false" schemaversion="4">
<suite id="s1" name="Inputbox" source="C:\Users\lukas\Mega\Data\GitHub\Robot_Framework\RobotSelenium\Techie\TestCases\Inputbox.robot">
<test id="s1-t1" name="TestingInputBox" line="8">
<kw name="Open Browser" library="SeleniumLibrary">
<arg>https://demo.nopcommerce.com/</arg>
<arg>chrome</arg>
<arg>${url}</arg>
<arg>${browser}</arg>
<doc>Opens a new browser instance to the optional ``url``.</doc>
<msg timestamp="20231013 14:31:14.610" level="INFO">Opening browser 'chrome' to base url 'https://demo.nopcommerce.com/'.</msg>
<status status="PASS" starttime="20231013 14:31:14.609" endtime="20231013 14:31:17.177"/>
<msg timestamp="20231013 23:21:55.147" level="INFO">Opening browser 'chrome' to base url 'https://demo.nopcommerce.com/'.</msg>
<status status="PASS" starttime="20231013 23:21:55.146" endtime="20231013 23:22:04.801"/>
</kw>
<kw name="Maximize Browser Window" library="SeleniumLibrary">
<doc>Maximizes current browser window.</doc>
<status status="PASS" starttime="20231013 23:22:04.802" endtime="20231013 23:22:04.943"/>
</kw>
<kw name="Title Should Be" library="SeleniumLibrary">
<arg>nopCommerce demo store</arg>
<doc>Verifies that the current page title equals ``title``.</doc>
<msg timestamp="20231013 23:22:04.962" level="INFO">Page title is 'nopCommerce demo store'.</msg>
<status status="PASS" starttime="20231013 23:22:04.944" endtime="20231013 23:22:04.962"/>
</kw>
<kw name="Click Link" library="SeleniumLibrary">
<arg>xpath://a[@class="ico-login"]</arg>
<doc>Clicks a link identified by ``locator``.</doc>
<msg timestamp="20231013 14:31:17.179" level="INFO">Clicking link 'xpath://a[@class="ico-login"]'.</msg>
<msg timestamp="20231013 14:31:17.348" level="INFO" html="true">&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;a href="selenium-screenshot-4.png"&gt;&lt;img src="selenium-screenshot-4.png" width="800px"&gt;&lt;/a&gt;</msg>
<msg timestamp="20231013 14:31:17.348" level="FAIL">Link with locator 'xpath://a[@class="ico-login"]' not found.</msg>
<status status="FAIL" starttime="20231013 14:31:17.178" endtime="20231013 14:31:17.351"/>
<msg timestamp="20231013 23:22:04.965" level="INFO">Clicking link 'xpath://a[@class="ico-login"]'.</msg>
<status status="PASS" starttime="20231013 23:22:04.963" endtime="20231013 23:22:06.024"/>
</kw>
<kw name="Set Variable" library="BuiltIn">
<var>${"email_txt"}</var>
<arg>id:Email</arg>
<doc>Returns the given values which can then be assigned to a variables.</doc>
<msg timestamp="20231013 23:22:06.026" level="INFO">${"email_txt"} = id:Email</msg>
<status status="PASS" starttime="20231013 23:22:06.026" endtime="20231013 23:22:06.026"/>
</kw>
<kw name="Element Should Be Visible" library="SeleniumLibrary">
<arg>${"email_txt"}</arg>
<doc>Verifies that the element identified by ``locator`` is visible.</doc>
<msg timestamp="20231013 23:22:06.088" level="INFO">Element 'id:Email' is displayed.</msg>
<status status="PASS" starttime="20231013 23:22:06.027" endtime="20231013 23:22:06.088"/>
</kw>
<kw name="Element Should Be Enabled" library="SeleniumLibrary">
<arg>${"email_txt"}</arg>
<doc>Verifies that element identified by ``locator`` is enabled.</doc>
<status status="PASS" starttime="20231013 23:22:06.089" endtime="20231013 23:22:06.179"/>
</kw>
<kw name="Input Text" library="SeleniumLibrary">
<arg>id:Email testing@gmail.com</arg>
<arg>${"email_txt"}</arg>
<arg>superborec@gmail.com</arg>
<doc>Types the given ``text`` into the text field identified by ``locator``.</doc>
<status status="NOT RUN" starttime="20231013 14:31:17.352" endtime="20231013 14:31:17.352"/>
<msg timestamp="20231013 23:22:06.181" level="INFO">Typing text 'superborec@gmail.com' into text field 'id:Email'.</msg>
<status status="PASS" starttime="20231013 23:22:06.180" endtime="20231013 23:22:06.370"/>
</kw>
<kw name="Input Text" library="SeleniumLibrary">
<arg>id:Password Test@123</arg>
<doc>Types the given ``text`` into the text field identified by ``locator``.</doc>
<status status="NOT RUN" starttime="20231013 14:31:17.352" endtime="20231013 14:31:17.352"/>
<kw name="Sleep" library="BuiltIn">
<arg>5</arg>
<doc>Pauses the test executed for the given time.</doc>
<msg timestamp="20231013 23:22:11.372" level="INFO">Slept 5 seconds</msg>
<status status="PASS" starttime="20231013 23:22:06.371" endtime="20231013 23:22:11.372"/>
</kw>
<kw name="Click Element" library="SeleniumLibrary">
<arg>xpath://input[@class='button-1 Login-button']</arg>
<doc>Click the element identified by ``locator``.</doc>
<status status="NOT RUN" starttime="20231013 14:31:17.352" endtime="20231013 14:31:17.352"/>
<kw name="Clear Element Text" library="SeleniumLibrary">
<arg>${"email_txt"}</arg>
<doc>Clears the value of the text-input-element identified by ``locator``.</doc>
<status status="PASS" starttime="20231013 23:22:11.372" endtime="20231013 23:22:11.449"/>
</kw>
<kw name="Sleep" library="BuiltIn">
<arg>3</arg>
<doc>Pauses the test executed for the given time.</doc>
<msg timestamp="20231013 23:22:14.451" level="INFO">Slept 3 seconds</msg>
<status status="PASS" starttime="20231013 23:22:11.450" endtime="20231013 23:22:14.451"/>
</kw>
<kw name="Close Browser" library="SeleniumLibrary">
<doc>Closes the current browser.</doc>
<status status="NOT RUN" starttime="20231013 14:31:17.353" endtime="20231013 14:31:17.353"/>
<status status="PASS" starttime="20231013 23:22:14.451" endtime="20231013 23:22:16.908"/>
</kw>
<status status="FAIL" starttime="20231013 14:31:14.608" endtime="20231013 14:31:17.353">Link with locator 'xpath://a[@class="ico-login"]' not found.</status>
<status status="PASS" starttime="20231013 23:21:55.145" endtime="20231013 23:22:16.909"/>
</test>
<status status="FAIL" starttime="20231013 14:31:14.427" endtime="20231013 14:31:17.354"/>
<status status="PASS" starttime="20231013 23:21:54.719" endtime="20231013 23:22:16.911"/>
</suite>
<statistics>
<total>
<stat pass="0" fail="1" skip="0">All Tests</stat>
<stat pass="1" fail="0" skip="0">All Tests</stat>
</total>
<tag>
</tag>
<suite>
<stat pass="0" fail="1" skip="0" id="s1" name="TC1">TC1</stat>
<stat pass="1" fail="0" skip="0" id="s1" name="Inputbox">Inputbox</stat>
</suite>
</statistics>
<errors>

View File

@ -1629,22 +1629,22 @@ storage = function () {
window.output = {};
</script>
<script type="text/javascript">
window.output["suite"] = [1,2,3,0,[],[0,0,2927],[],[[4,0,0,[],[0,181,2745,5],[]]],[],[1,0,1,0]];
window.output["suite"] = [1,2,3,0,[],[1,0,22192],[],[[4,0,0,[],[1,426,21764],[]]],[],[1,1,0,0]];
</script>
<script type="text/javascript">
window.output["strings"] = [];
</script>
<script type="text/javascript">
window.output["strings"] = window.output["strings"].concat(["*","*TC1","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Techie\\TestCases\\TC1.robot","*TestCases/TC1.robot","*LoginTest","*Link with locator '<a href=\"xpath://a[@class=&quot;ico-login\">xpath://a[@class=\"ico-login\x3c/a>\"]' not found."]);
window.output["strings"] = window.output["strings"].concat(["*","*Inputbox","*C:\\Users\\lukas\\Mega\\Data\\GitHub\\Robot_Framework\\RobotSelenium\\Techie\\TestCases\\Inputbox.robot","*TestCases/Inputbox.robot","*TestingInputBox"]);
</script>
<script type="text/javascript">
window.output["stats"] = [[{"elapsed":"00:00:03","fail":1,"label":"All Tests","pass":0,"skip":0}],[],[{"elapsed":"00:00:03","fail":1,"id":"s1","label":"TC1","name":"TC1","pass":0,"skip":0}]];
window.output["stats"] = [[{"elapsed":"00:00:22","fail":0,"label":"All Tests","pass":1,"skip":0}],[],[{"elapsed":"00:00:22","fail":0,"id":"s1","label":"Inputbox","name":"Inputbox","pass":1,"skip":0}]];
</script>
<script type="text/javascript">
window.output["baseMillis"] = 1697200274427;
window.output["baseMillis"] = 1697232114719;
</script>
<script type="text/javascript">
window.output["generated"] = 2934;
window.output["generated"] = 22204;
</script>
<script type="text/javascript">
window.output["expand_keywords"] = null;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB