Skip to content

Commit 24fe8ee

Browse files
committed
environment variable fix
1 parent e6425ad commit 24fe8ee

18 files changed

+80
-105
lines changed

.DS_Store

6 KB
Binary file not shown.

.gitignore

100644100755
+4
Original file line numberDiff line numberDiff line change
@@ -130,3 +130,7 @@ dmypy.json
130130
/.idea/
131131
/report.html
132132
/log.html
133+
134+
/output.xml
135+
log.html
136+
report.html

Makefile

100644100755
+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ run_all_in_parallel:
22
make -j test_GalaxyS20Plus #test_GalaxyS10
33

44
test_GalaxyS20Plus:
5-
robot --variable version:10 --variable platform:Android --variable deviceName:"Galaxy S20" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/Android.robot
5+
robot --variable version:10 --variable platformName:Android --variable deviceName:"Galaxy S20" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/Android.robot
66

77
test_GalaxyS10:
8-
robot --variable version:10 --variable platform:Android --variable deviceName:"Galaxy S10" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/Android.robot
8+
robot --variable version:10 --variable platformName:Android --variable deviceName:"Galaxy S10" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/Android.robot
9+
10+
test_Android1:
11+
robot --variable version:10 --variable platformName:android --variable deviceName:"Galaxy .*" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/Android.robot
12+
13+
test_ios1:
14+
robot --variable version:14 --variable platformName:ios --variable deviceName:"iPhone .*" --variable isRealMobile:true --variable visual:false --variable network:false --variable console:false Tests/IOS.robot

README.md

100644100755
File mode changed.

Resources/AndroidCommon.robot

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
*** Settings ***
2+
Library AppiumLibrary
3+
4+
*** Variables ***
5+
env var
6+
${LT_USERNAME}= Get Environment Variable LT_USERNAME
7+
${LT_ACCESS_KEY}= Get Environment Variable LT_ACCESS_KEY
8+
9+
@{_tmp}
10+
... platformName: ${platformName}
11+
... platformVersion: ${version}
12+
... deviceName: ${deviceName}
13+
... visual: ${visual}
14+
... network: ${network}
15+
... isRealMobile: ${isRealMobile}
16+
... name: 'RobotFramework Lambda Test'
17+
... app: 'lt://proverbial-android'
18+
19+
#${BROWSER} ${ROBOT_BROWSER}
20+
${CAPABILITIES} ${EMPTY.join(${_tmp})}
21+
${REMOTE_URL} https://${LT_USERNAME}:${LT_ACCESS_KEY}@mobile-hub.lambdatest.com/wd/hub
22+
#${app} lt://APP100201841649255527998398
23+
${app} lt://proverbial-android
24+
${TIMEOUT} 3000
25+
26+
*** Keywords ***
27+
28+
Open test app
29+
[Timeout] ${TIMEOUT}
30+
#Open Application ${REMOTE_URL} platformName=${platformName} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} name="RobotFramework Lambda Test"
31+
Open Application ${REMOTE_URL} platformName=${platformName} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} app=${app} name="RobotFramework Lambda Test"
32+
33+
Close test app
34+
Close All Applications

Resources/Common.robot

100644100755
+8-6
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,31 @@
22
Library AppiumLibrary
33

44
*** Variables ***
5+
${LT_USERNAME}= Get Environment Variable LT_USERNAME
6+
${LT_ACCESS_KEY}= Get Environment Variable LT_ACCESS_KEY
57

6-
@{_tmp} platformName: ${platform}
8+
@{_tmp} platformName: ${platformName}
79
... platformVersion: ${version}
810
... deviceName:${deviceName}
911
... visual: ${visual}
1012
... network: ${network}
1113
... isRealMobile: ${isRealMobile}
1214
... name: 'RobotFramework Lambda Test'
13-
... app: 'lt://APP10020211648037120590170'
15+
... app: 'lt://proverbial-ios'
1416

1517
#${BROWSER} ${ROBOT_BROWSER}
1618
${CAPABILITIES} ${EMPTY.join(${_tmp})}
17-
${REMOTE_URL} https://ankitagarwal:oWiWwbdUGNg0RuUkTid4E1IL6w2nbavQLBFFcolfIwtbA6Ey3K@qa-beta-hub.lambdatest.com/wd/hub
19+
${REMOTE_URL} https://${LT_USERNAME}:${LT_ACCESS_KEY}@mobile-hub.lambdatest.com/wd/hub
1820
#${app} lt://APP100201841649255527998398
19-
${app} lt://APP10093511649258101281814
21+
${app} lt://proverbial-ios
2022
${TIMEOUT} 3000
2123

2224
*** Keywords ***
2325

2426
Open test app
2527
[Timeout] ${TIMEOUT}
26-
#Open Application ${REMOTE_URL} platformName=${platform} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} name="RobotFramework Lambda Test"
27-
Open Application ${REMOTE_URL} platformName=${platform} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} app=${app} name="RobotFramework Lambda Test"
28+
#Open Application ${REMOTE_URL} platformName=${platformName} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} name="RobotFramework Lambda Test"
29+
Open Application ${REMOTE_URL} platformName=${platformName} platformVersion=${version} deviceName=${deviceName} visual=${visual} network=${network} isRealMobile=${isRealMobile} app=${app} name="RobotFramework Lambda Test"
2830

2931
Close test app
3032
Close All Applications

Resources/LambdaTestStatus.py

100644100755
File mode changed.

Tests/Android.robot

100644100755
+6-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
*** Settings ***
22

3-
Resource ../Resources/Common.robot
3+
Resource ../Resources/AndroidCommon.robot
44

5-
Test Setup Common.Open test app
6-
Test Teardown Common.Close test app
5+
Test Setup AndroidCommon.Open test app
6+
Test Teardown AndroidCommon.Close test app
77

88
*** Variables ***
99
${TIMEOUT} 3000
@@ -14,10 +14,10 @@ Example of connecting to Lambdatest via Robot Framework
1414
[Timeout] ${TIMEOUT}
1515
Click button id=color
1616
Click button id=Text
17-
Click button id=Toast
17+
Click button id=toast
1818

19-
Click button id=Notification
20-
Click button id=GeoLocation
19+
Click button id=notification
20+
Click button id=geoLocation
2121
sleep ${delay}
2222
Click button id=Speed Test
2323
sleep ${delay}

Tests/IOS.robot

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ Example of connecting to Lambdatest via Robot Framework
1414
[Timeout] ${TIMEOUT}
1515
Click button id=color
1616
Click button id=Text
17-
Click button id=Toast
17+
Click button id=toast
1818

19-
Click button id=Notification
20-
Click button id=GeoLocation
19+
Click button id=notification
20+
Click button id=geoLocation
2121
sleep ${delay}
2222
Click button id=Speed Test
2323
sleep ${delay}

appium-screenshot-1.png

100644100755
File mode changed.

make.exe

100644100755
File mode changed.

output.xml

100644100755
+16-87
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<robot generator="Robot 4.1.3 (Python 3.9.12 on darwin)" generated="20220406 21:20:40.254" rpa="false" schemaversion="2">
3-
<suite id="s1" name="Android" source="/Users/admin/Documents/Robot-Selenium-Sample/Tests/Android.robot">
4-
<test id="s1-t1" name="Example of connecting to Lambdatest via Robot Framework">
2+
<robot generator="Robot 6.0.1 (Python 3.10.8 on darwin)" generated="20230105 14:18:48.631" rpa="false" schemaversion="3">
3+
<suite id="s1" name="IOS" source="/Users/ankitagarwal/Documents/Code-Snippet/LT-appium-python-robot/Tests/IOS.robot">
4+
<test id="s1-t1" name="Example of connecting to Lambdatest via Robot Framework" line="13">
55
<kw name="Open test app" library="Common" type="SETUP">
66
<kw name="Open Application" library="AppiumLibrary">
77
<arg>${REMOTE_URL}</arg>
8-
<arg>platformName=${platform}</arg>
8+
<arg>platformName=${platformName}</arg>
99
<arg>platformVersion=${version}</arg>
1010
<arg>deviceName=${deviceName}</arg>
1111
<arg>visual=${visual}</arg>
@@ -19,100 +19,28 @@ Please check https://github.com/appium/appium/blob/master/docs/en/writing-runnin
1919
| *Option* | *Man.* | *Description* |
2020
| remote_url | Yes | Appium server url |
2121
| alias | no | alias |</doc>
22-
<status status="PASS" starttime="20220406 21:20:40.472" endtime="20220406 21:20:54.702"/>
23-
</kw>
24-
<timeout value="50 minutes"/>
25-
<status status="PASS" starttime="20220406 21:20:40.471" endtime="20220406 21:20:54.702"/>
26-
</kw>
27-
<kw name="Click Button" library="AppiumLibrary">
28-
<arg>id=color</arg>
29-
<doc>Click button</doc>
3022
<kw name="Capture Page Screenshot" library="AppiumLibrary">
3123
<doc>Takes a screenshot of the current page and embeds it into the log.</doc>
32-
<msg timestamp="20220406 21:21:01.229" level="INFO" html="true">&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan="3"&gt;&lt;a href="appium-screenshot-1.png"&gt;&lt;img src="appium-screenshot-1.png" width="800px"&gt;&lt;/a&gt;</msg>
33-
<status status="PASS" starttime="20220406 21:20:59.550" endtime="20220406 21:21:01.230"/>
34-
</kw>
35-
<msg timestamp="20220406 21:20:55.637" level="INFO">'COLOR'.</msg>
36-
<msg timestamp="20220406 21:20:56.327" level="INFO">'GEOLOCATION'.</msg>
37-
<msg timestamp="20220406 21:20:57.015" level="INFO">'TEXT'.</msg>
38-
<msg timestamp="20220406 21:20:57.700" level="INFO">'NOTIFICATION'.</msg>
39-
<msg timestamp="20220406 21:20:58.462" level="INFO">'TOAST'.</msg>
40-
<msg timestamp="20220406 21:20:59.139" level="INFO">'SPEED TEST'.</msg>
41-
<msg timestamp="20220406 21:21:01.237" level="FAIL">TypeError: exceptions must derive from BaseException</msg>
42-
<status status="FAIL" starttime="20220406 21:20:54.703" endtime="20220406 21:21:01.237"/>
43-
</kw>
44-
<kw name="Click Button" library="AppiumLibrary">
45-
<arg>id=Text</arg>
46-
<doc>Click button</doc>
47-
<status status="NOT RUN" starttime="20220406 21:21:01.238" endtime="20220406 21:21:01.238"/>
48-
</kw>
49-
<kw name="Click Button" library="AppiumLibrary">
50-
<arg>id=Toast</arg>
51-
<doc>Click button</doc>
52-
<status status="NOT RUN" starttime="20220406 21:21:01.238" endtime="20220406 21:21:01.239"/>
53-
</kw>
54-
<kw name="Click Button" library="AppiumLibrary">
55-
<arg>id=Notification</arg>
56-
<doc>Click button</doc>
57-
<status status="NOT RUN" starttime="20220406 21:21:01.239" endtime="20220406 21:21:01.239"/>
58-
</kw>
59-
<kw name="Click Button" library="AppiumLibrary">
60-
<arg>id=GeoLocation</arg>
61-
<doc>Click button</doc>
62-
<status status="NOT RUN" starttime="20220406 21:21:01.239" endtime="20220406 21:21:01.240"/>
24+
<status status="FAIL" starttime="20230105 14:19:53.734" endtime="20230105 14:19:53.735"/>
6325
</kw>
64-
<kw name="Sleep" library="BuiltIn">
65-
<arg>${delay}</arg>
66-
<doc>Pauses the test executed for the given time.</doc>
67-
<status status="NOT RUN" starttime="20220406 21:21:01.240" endtime="20220406 21:21:01.240"/>
26+
<msg timestamp="20230105 14:19:53.736" level="WARN">Keyword 'Capture Page Screenshot' could not be run on failure: Execution terminated by signal</msg>
27+
<status status="FAIL" starttime="20230105 14:18:48.712" endtime="20230105 14:19:53.736"/>
6828
</kw>
69-
<kw name="Click Button" library="AppiumLibrary">
70-
<arg>id=Speed Test</arg>
71-
<doc>Click button</doc>
72-
<status status="NOT RUN" starttime="20220406 21:21:01.240" endtime="20220406 21:21:01.240"/>
73-
</kw>
74-
<kw name="Sleep" library="BuiltIn">
75-
<arg>${delay}</arg>
76-
<doc>Pauses the test executed for the given time.</doc>
77-
<status status="NOT RUN" starttime="20220406 21:21:01.240" endtime="20220406 21:21:01.241"/>
78-
</kw>
79-
<kw name="Click Button" library="AppiumLibrary">
80-
<arg>id='start speed test - connection type multi'</arg>
81-
<doc>Click button</doc>
82-
<status status="NOT RUN" starttime="20220406 21:21:01.241" endtime="20220406 21:21:01.241"/>
83-
</kw>
84-
<kw name="Sleep" library="BuiltIn">
85-
<arg>${delay}</arg>
86-
<doc>Pauses the test executed for the given time.</doc>
87-
<status status="NOT RUN" starttime="20220406 21:21:01.241" endtime="20220406 21:21:01.241"/>
88-
</kw>
89-
<kw name="Click Button" library="AppiumLibrary">
90-
<arg>id=Browser</arg>
91-
<doc>Click button</doc>
92-
<status status="NOT RUN" starttime="20220406 21:21:01.241" endtime="20220406 21:21:01.242"/>
93-
</kw>
94-
<kw name="Input Text" library="AppiumLibrary">
95-
<arg>id=Search</arg>
96-
<arg>https://lambdatest.com</arg>
97-
<doc>Types the given `text` into text field identified by `locator`.</doc>
98-
<status status="NOT RUN" starttime="20220406 21:21:01.242" endtime="20220406 21:21:01.242"/>
99-
</kw>
100-
<kw name="Click Button" library="AppiumLibrary">
101-
<arg>id=find</arg>
102-
<doc>Click button</doc>
103-
<status status="NOT RUN" starttime="20220406 21:21:01.242" endtime="20220406 21:21:01.242"/>
29+
<timeout value="50 minutes"/>
30+
<status status="FAIL" starttime="20230105 14:18:48.712" endtime="20230105 14:19:53.736"/>
10431
</kw>
10532
<kw name="Close test app" library="Common" type="TEARDOWN">
10633
<kw name="Close All Applications" library="AppiumLibrary">
10734
<doc>Closes all open applications.</doc>
108-
<status status="PASS" starttime="20220406 21:21:01.244" endtime="20220406 21:21:01.470"/>
35+
<status status="PASS" starttime="20230105 14:19:53.737" endtime="20230105 14:19:53.737"/>
10936
</kw>
110-
<status status="PASS" starttime="20220406 21:21:01.243" endtime="20220406 21:21:01.470"/>
37+
<status status="PASS" starttime="20230105 14:19:53.736" endtime="20230105 14:19:53.737"/>
11138
</kw>
11239
<timeout value="50 minutes"/>
113-
<status status="FAIL" starttime="20220406 21:20:40.470" endtime="20220406 21:21:01.470">TypeError: exceptions must derive from BaseException</status>
40+
<status status="FAIL" starttime="20230105 14:18:48.712" endtime="20230105 14:19:53.738">Setup failed:
41+
Execution terminated by signal</status>
11442
</test>
115-
<status status="FAIL" starttime="20220406 21:20:40.256" endtime="20220406 21:21:01.471"/>
43+
<status status="FAIL" starttime="20230105 14:18:48.632" endtime="20230105 14:19:53.738"/>
11644
</suite>
11745
<statistics>
11846
<total>
@@ -121,9 +49,10 @@ Please check https://github.com/appium/appium/blob/master/docs/en/writing-runnin
12149
<tag>
12250
</tag>
12351
<suite>
124-
<stat pass="0" fail="1" skip="0" id="s1" name="Android">Android</stat>
52+
<stat pass="0" fail="1" skip="0" id="s1" name="IOS">IOS</stat>
12553
</suite>
12654
</statistics>
12755
<errors>
56+
<msg timestamp="20230105 14:19:53.736" level="WARN">Keyword 'Capture Page Screenshot' could not be run on failure: Execution terminated by signal</msg>
12857
</errors>
12958
</robot>

requirements.txt

100644100755
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
selenium
1+
selenium==3.141.0
22
robotframework
33
robotframework-appiumlibrary

tutorial-images/logo.PNG

100644100755
File mode changed.

tutorial-images/rfpt.PNG

100644100755
File mode changed.

tutorial-images/rfsample.PNG

100644100755
File mode changed.

tutorial-images/rfst.PNG

100644100755
File mode changed.

tutorial-images/tn.PNG

100644100755
File mode changed.

0 commit comments

Comments
 (0)