Commit d01d53f5 authored by wwalkowski's avatar wwalkowski

No commit message

No commit message
parent 910f2c9e
......@@ -70,79 +70,71 @@
<h2>DLNA CTT DMR.sikuli\DLNA CTT DMR.sikuli</h2> <a href="DLNA CTT DMR.sikuli\DLNA CTT DMR.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">import</span> Utils
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Launching DLNA CTT for Digital Media Renderer"</span> )
Utils.killAllTools()
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Bringing down all tools, if they happen to be up"</span> )
<span class="skw">click</span>(<img src="1370639415030.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch tool
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="skw">click</span>(<img src="1371158736559.png" />)
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Launching app"</span> )
dlnaCTT = App(<span class="str">"C:\\Program Files (x86)\\Digital Living Network Alliance\\DLNA CTT v1.5 (2011 Guidelines)\\CTT.exe"</span>)
dlnaCTT.open()
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch tool
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="cmt"># OK the Manage Test Media window
</span><span class="skw">find</span>(<img src="1370385233306.png" />)
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - OK the Manage Test Media window"</span> )
<span class="skw">find</span>(<img src="1370385233306.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370385250314.png" />)
<span class="cmt"># Get past the Network Interface window
</span>
<span class="cmt">#dlnaCTT.focus()
</span><span class="kw">if</span> exists(<img src="1369436364973.png" />):
dlnaCTT.focus()
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - OK the Network Interface window"</span> )
<span class="kw">if</span> exists(<img src="1369436364973.png" />):
<span class="skw">click</span>(<img src="1369436375230.png" />)
<span class="cmt"># Load Profile
</span>
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Loading the Profile"</span> )
<span class="cmt"># Open list of profiles
</span><span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370472176068.png" />)
<span class="cmt"># do not focus here, the drop down menu will disappear
</span>
<span class="skw">click</span>(<img src="1370386016919.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370386292743.png" />)
<span class="cmt"># Select Renderer device
</span>
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Selecting the device"</span> )
<span class="cmt">#
</span><span class="cmt"># This is the UPnP Friendly Name, and is by nature device specific
</span><span class="cmt">#
</span><span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">wait</span>(<img src="1370472295354.png" />, <span class="dig">5</span>)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370472295354.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370472370187.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="cmt"># Select Auto tests
</span><span class="skw">click</span>(<img src="1370472404187.png" />)
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Selecting Auto Tests"</span> )
<span class="skw">click</span>(<img src="1370472404187.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch the test run and sleep
</span><span class="cmt">#-------------------------------------------------------
</span>
</span>sleepTime = <span class="dig">25</span> * <span class="dig">60</span>
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Starting the test run, and sleeping for a fixed "</span>, (sleepTime / <span class="dig">60</span>), <span class="str">" minutes"</span> )
<span class="cmt">#click("1370472473883.png")
</span>
<span class="cmt"># Sleep until well after test run has completed - 25mins
......@@ -153,16 +145,11 @@ dlnaCTT.open()
<span class="cmt"># Start - Launch a single test for testing purposes
</span><span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(Pattern(<img src="1370545400919.png" />).targetOffset(-<span class="dig">68</span>,<span class="dig">0</span>))
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370545463422.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370545494663.png" />)
<span class="skw">sleep</span> ( <span class="dig">45</span> )
......@@ -179,35 +166,28 @@ dlnaCTT.open()
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="cmt"># Save results
</span><span class="cmt">#dlnaCTT.focus()
</span>
</span><span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Saving the test results"</span> )
<span class="skw">click</span>(<img src="1370475057021.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
textBox = <span class="skw">find</span>(<img src="1370475089332.png" />)
<span class="cmt"># dlnaCTT.focus() DO NOT FOCUS
</span>
textBox.<span class="skw">type</span> ( <span class="str">"C:\dmr_dlna_ctt_results.trf"</span> )
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="skw">click</span>(<img src="1370475316507.png" />)
<span class="cmt">#dlnaCTT.focus()
</span>
<span class="kw">if</span> exists(<img src="1370543994284.png" />):
<span class="cmt"># dlnaCTT.focus()
</span> <span class="skw">click</span>(<img src="1370544016236.png" />)
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Yes, overwrite existing test results"</span> )
<span class="skw">click</span>(<img src="1370544016236.png" />)
<span class="cmt"># Close CTT
</span><span class="cmt">#dlnaCTT.focus()
</span>
<span class="kw">print</span> ( <span class="str">"DLNA CTT DMR - Exiting"</span> )
<span class="skw">click</span>(Pattern(<img src="1370475354988.png" />).targetOffset(-<span class="dig">15</span>,-<span class="dig">15</span>))
<span class="cmt"># dlnaCTT.focus() DO NOT FOCUS
</span>
<span class="skw">click</span>(Pattern(<img src="1370475431276.png" />).targetOffset(-<span class="dig">38</span>,<span class="dig">50</span>))
</pre>
</body>
......
import Utils
print ( "DLNA CTT DMR - Launching DLNA CTT for Digital Media Renderer" )
Utils.killAllTools()
print ( "DLNA CTT DMR - Bringing down all tools, if they happen to be up" )
click("1370639415030.png")
#-------------------------------------------------------
# Launch tool
#-------------------------------------------------------
click("1371158736559.png")
print ( "DLNA CTT DMR - Launching app" )
dlnaCTT = App("C:\\Program Files (x86)\\Digital Living Network Alliance\\DLNA CTT v1.5 (2011 Guidelines)\\CTT.exe")
dlnaCTT.open()
#dlnaCTT.focus()
#-------------------------------------------------------
# Launch tool
#-------------------------------------------------------
# OK the Manage Test Media window
find("1370385233306.png")
print ( "DLNA CTT DMR - OK the Manage Test Media window" )
#dlnaCTT.focus()
find("1370385233306.png")
click("1370385250314.png")
# Get past the Network Interface window
print ( "DLNA CTT DMR - OK the Network Interface window" )
#dlnaCTT.focus()
if exists("1369436364973.png"):
dlnaCTT.focus()
click("1369436375230.png")
# Load Profile
print ( "DLNA CTT DMR - Loading the Profile" )
# Open list of profiles
#dlnaCTT.focus()
click("1370472176068.png")
# do not focus here, the drop down menu will disappear
click("1370386016919.png")
#dlnaCTT.focus()
click("1370386292743.png")
# Select Renderer device
print ( "DLNA CTT DMR - Selecting the device" )
#
# This is the UPnP Friendly Name, and is by nature device specific
#
#dlnaCTT.focus()
wait("1370472295354.png", 5)
#dlnaCTT.focus()
click("1370472295354.png")
#dlnaCTT.focus()
click("1370472370187.png")
#dlnaCTT.focus()
# Select Auto tests
print ( "DLNA CTT DMR - Selecting Auto Tests" )
click("1370472404187.png")
#-------------------------------------------------------
# Launch the test run and sleep
#-------------------------------------------------------
sleepTime = 25 * 60
print ( "DLNA CTT DMR - Starting the test run, and sleeping for a fixed ", (sleepTime / 60), " minutes" )
#click("1370472473883.png")
......@@ -81,16 +73,11 @@ click("1370472404187.png")
# Start - Launch a single test for testing purposes
#dlnaCTT.focus()
click(Pattern("1370545400919.png").targetOffset(-68,0))
#dlnaCTT.focus()
click("1370545463422.png")
#dlnaCTT.focus()
click("1370545494663.png")
sleep ( 45 )
......@@ -107,34 +94,27 @@ sleep ( 45 )
#-------------------------------------------------------
# Save results
#dlnaCTT.focus()
print ( "DLNA CTT DMR - Saving the test results" )
click("1370475057021.png")
#dlnaCTT.focus()
textBox = find("1370475089332.png")
# dlnaCTT.focus() DO NOT FOCUS
textBox.type ( "C:\dmr_dlna_ctt_results.trf" )
#dlnaCTT.focus()
click("1370475316507.png")
#dlnaCTT.focus()
if exists("1370543994284.png"):
# dlnaCTT.focus()
print ( "DLNA CTT DMR - Yes, overwrite existing test results" )
click("1370544016236.png")
# Close CTT
#dlnaCTT.focus()
click(Pattern("1370475354988.png").targetOffset(-15,-15))
print ( "DLNA CTT DMR - Exiting" )
# dlnaCTT.focus() DO NOT FOCUS
click(Pattern("1370475354988.png").targetOffset(-15,-15))
click(Pattern("1370475431276.png").targetOffset(-38,50))
<html>
<head>
<style type="text/css">
.sikuli-code {
font-size: 20px;
font-family: "Osaka-mono", Monospace;
line-height: 1.5em;
display:table-cell;
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* Internet Explorer 5.5+ */
width: 99%; /* remove horizontal scroll-bar when viewing in IE7 */
}
.sikuli-code img {
vertical-align: middle;
margin: 2px;
border: 1px solid #ccc;
padding: 2px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
-moz-box-shadow: 1px 1px 1px gray;
-webkit-box-shadow: 1px 1px 2px gray;
}
.kw {
color: blue;
}
.skw {
color: rgb(63, 127, 127);
}
.str {
color: rgb(128, 0, 0);
}
.dig {
color: rgb(128, 64, 0);
}
.cmt {
color: rgb(200, 0, 200);
}
h2 {
display: inline;
font-weight: normal;
}
.info {
border-bottom: 1px solid #ddd;
padding-bottom: 5px;
margin-bottom: 20px;
display: none;
}
a {
color: #9D2900;
}
body {
font-family: "Trebuchet MS", Arial, Sans-Serif;
}
</style>
</head>
<body>
<div class="info">
<h2>Shutdown All Tools.sikuli\Shutdown All Tools.sikuli</h2> <a href="Shutdown All Tools.sikuli\Shutdown All Tools.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">from</span> sikuli <span class="kw">import</span> *
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Kill Task Manager if it is currently running
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="kw">if</span> exists(<img src="1370889835334.png" />):
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - Closing existing TaskManager"</span> )
<span class="skw">rightClick</span>(<img src="1370889859566.png" />)
<span class="kw">if</span> exists(<img src="1370889919007.png" />):
<span class="skw">click</span>(<img src="1370889957997.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch Task Manager to check if tools are running
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - Launching TaskManager"</span> )
<span class="skw">click</span>(<img src="1370638730338.png" />)
textBox = <span class="skw">find</span>(<img src="1370638755314.png" />)
textBox.<span class="skw">type</span> ( <span class="str">"taskmgr.exe"</span> )
hover ( <img src="1370638898178.png" /> )
<span class="skw">click</span>(<img src="1370638925410.png" />)
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - TaskManager launched"</span> )
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Kill DLNA CTT if it is running
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="cmt"># Arrange process names in ascending order so we can find
</span><span class="cmt"># the DLNA CTT
</span><span class="kw">if</span> exists(Pattern(<img src="1370995038447.png" />).exact()):
<span class="skw">click</span>(Pattern(<img src="1370995057303.png" />).exact())
<span class="kw">if</span> exists(<img src="1370639797580.png" />):
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - Closing existing DLNA CTT"</span> )
<span class="skw">rightClick</span>(<img src="1370639812491.png" />)
<span class="skw">click</span>(<img src="1370639665222.png" />)
<span class="skw">click</span>(<img src="1370639089876.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Kill UPnP CTT if it is running
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="cmt"># Arrange process names in descending order so we can find
</span><span class="cmt"># the UPnP CTT
</span><span class="kw">if</span> exists(Pattern(<img src="1370889407360.png" />).exact()):
<span class="skw">click</span>(Pattern(<img src="1370889425024.png" />).exact())
<span class="kw">if</span> exists(Pattern(<img src="1370889534033.png" />).similar(<span class="dig">0.94</span>)):
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - Closing existing UPnP CTT"</span> )
<span class="skw">rightClick</span>(<img src="1370889551889.png" />)
<span class="skw">click</span>(<img src="1370639665222.png" />)
<span class="skw">click</span>(<img src="1370639089876.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Close Task Manager
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="kw">print</span> ( <span class="str">"ShutDownAllTools - Closing TaskManager"</span> )
<span class="skw">click</span>(Pattern(<img src="1370639150858.png" />).targetOffset(-<span class="dig">65</span>,<span class="dig">9</span>))
<span class="skw">click</span>(Pattern(<img src="1370639198866.png" />).targetOffset(-<span class="dig">8</span>,<span class="dig">24</span>))
</pre>
</body>
</html>
from sikuli import *
#-------------------------------------------------------
# Kill Task Manager if it is currently running
#-------------------------------------------------------
if exists("1370889835334.png"):
print ( "ShutDownAllTools - Closing existing TaskManager" )
rightClick("1370889859566.png")
if exists("1370889919007.png"):
click("1370889957997.png")
#-------------------------------------------------------
# Launch Task Manager to check if tools are running
#-------------------------------------------------------
print ( "ShutDownAllTools - Launching TaskManager" )
click("1370638730338.png")
textBox = find("1370638755314.png")
textBox.type ( "taskmgr.exe" )
hover ( "1370638898178.png" )
click("1370638925410.png")
print ( "ShutDownAllTools - TaskManager launched" )
#-------------------------------------------------------
# Kill DLNA CTT if it is running
#-------------------------------------------------------
# Arrange process names in ascending order so we can find
# the DLNA CTT
if exists(Pattern("1370995038447.png").exact()):
click(Pattern("1370995057303.png").exact())
if exists("1370639797580.png"):
print ( "ShutDownAllTools - Closing existing DLNA CTT" )
rightClick("1370639812491.png")
click("1370639665222.png")
click("1370639089876.png")
#-------------------------------------------------------
# Kill UPnP CTT if it is running
#-------------------------------------------------------
# Arrange process names in descending order so we can find
# the UPnP CTT
if exists(Pattern("1370889407360.png").exact()):
click(Pattern("1370889425024.png").exact())
if exists(Pattern("1370889534033.png").similar(0.94)):
print ( "ShutDownAllTools - Closing existing UPnP CTT" )
rightClick("1370889551889.png")
click("1370639665222.png")
click("1370639089876.png")
#-------------------------------------------------------
# Close Task Manager
#-------------------------------------------------------
print ( "ShutDownAllTools - Closing TaskManager" )
click(Pattern("1370639150858.png").targetOffset(-65,9))
click(Pattern("1370639198866.png").targetOffset(-8,24))
......@@ -70,21 +70,27 @@
<h2>UPnP CTT DMR.sikuli\UPnP CTT DMR.sikuli</h2> <a href="UPnP CTT DMR.sikuli\UPnP CTT DMR.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">import</span> Utils
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Launching UPnP CTT for Digital Media Renderer"</span> )
Utils.killUpnp()
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Bringing down all tools, if they happen to be up"</span> )
<span class="skw">click</span>(<img src="1370889762943.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch tool
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="skw">click</span>(<img src="1371158757711.png" />)
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Launching app"</span> )
upnpCTT = App(<span class="str">"C:\\Program Files (x86)\\UPnP Certification Test Tool 2.0\\UCTT2.0.exe"</span>)
upnpCTT.open()
<span class="cmt">#upnpCTT.focus()
</span>
<span class="cmt"># Wait for main window to pop up
</span><span class="skw">wait</span>(<img src="1370893031803.png" />, <span class="dig">60</span>)
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Selecting DUT"</span> )
<span class="cmt"># Click file to select the DUT
</span><span class="skw">click</span>(Pattern(<img src="1370890871743.png" />).targetOffset(-<span class="dig">27</span>,-<span class="dig">8</span>))
......@@ -112,6 +118,14 @@ upnpCTT.open()
</span>
<span class="skw">click</span>(<img src="1370893504109.png" />)
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Launch the test run and sleep
</span><span class="cmt">#-------------------------------------------------------
</span>
sleepTime = <span class="dig">25</span> * <span class="dig">60</span>
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Starting the test run, and sleeping for a fixed "</span>, (sleepTime / <span class="dig">60</span>), <span class="str">" minutes"</span> )
<span class="cmt"># For prototyping only, select 1 test
</span>
<span class="skw">click</span>(<img src="1370984906937.png" />)
......@@ -120,8 +134,12 @@ upnpCTT.open()
<span class="skw">sleep</span> ( <span class="dig">10</span> )
<span class="cmt"># Save results
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Save results and exit
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Saving the test results"</span> )
<span class="skw">click</span>(<img src="1370985044333.png" />)
textBox = <span class="skw">find</span>(<img src="1370985089022.png" />)
......@@ -131,10 +149,16 @@ textBox.<span class="skw">type</span> ( <span class="str">"C:\dmr_upnp_ctt_resul
<span class="skw">click</span>(<img src="1370985156814.png" />)
<span class="kw">if</span> exists(Pattern(<img src="1370985251318.png" />).exact()):
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Yes, overwrite existing test results"</span> )
<span class="skw">click</span>(<img src="1370985294965.png" />)
<span class="cmt"># Exit UPnP CTT
</span><span class="skw">find</span>(<img src="1370985333381.png" />)
</span>
<span class="kw">print</span> ( <span class="str">"UPnP CTT DMR - Exiting"</span> )