Commit 81fcdfa9 authored by wwalkowski's avatar wwalkowski

Adding initial Sikuli projects

parent 0fe132a3
<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>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
Utils.killAllTools()
<span class="skw">click</span>(<img src="1370639415030.png" />)
dlnaCTT = App(<span class="str">"C:\\Program Files (x86)\\Digital Living Network Alliance\\DLNA CTT v1.5 (2011 Guidelines)\\CTT.exe"</span>)
dlnaCTT.open()
dlnaCTT.focus()
<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" />)
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370385250314.png" />)
<span class="cmt"># Get past the Network Interface window
</span>
dlnaCTT.focus()
<span class="kw">if</span> exists(<img src="1369436364973.png" />):
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1369436375230.png" />)
<span class="cmt"># Load Profile
</span>
<span class="cmt"># Open list of profiles
</span>dlnaCTT.focus()
<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" />)
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370386292743.png" />)
<span class="cmt"># Select Renderer 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>dlnaCTT.focus()
<span class="skw">wait</span>(<img src="1370472295354.png" />, <span class="dig">5</span>)
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370472295354.png" />)
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370472370187.png" />)
dlnaCTT.focus()
<span class="cmt"># Select 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 class="cmt">#click("1370472473883.png")
</span>
<span class="cmt"># Sleep until well after test run has completed - 25mins
</span><span class="cmt">#sleep ( 25 * 60 )
</span>
<span class="cmt"># Start - Launch a single test for testing purposes
</span>dlnaCTT.focus()
<span class="skw">click</span>(Pattern(<img src="1370545400919.png" />).targetOffset(-<span class="dig">68</span>,<span class="dig">0</span>))
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370545463422.png" />)
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370545494663.png" />)
<span class="skw">sleep</span> ( <span class="dig">45</span> )
<span class="cmt"># End - Launch a single test for testing purposes
</span>
<span class="cmt">#-------------------------------------------------------
</span><span class="cmt"># Save results and exit
</span><span class="cmt">#-------------------------------------------------------
</span>
<span class="cmt"># Save results
</span>dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370475057021.png" />)
dlnaCTT.focus()
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> )
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370475316507.png" />)
dlnaCTT.focus()
<span class="kw">if</span> exists(<img src="1370543994284.png" />):
dlnaCTT.focus()
<span class="skw">click</span>(<img src="1370544016236.png" />)
<span class="cmt"># Close CTT
</span>dlnaCTT.focus()
<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>
</html>
import Utils
Utils.killAllTools()
click("1370639415030.png")
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")
dlnaCTT.focus()
click("1370385250314.png")
# Get past the Network Interface window
dlnaCTT.focus()
if exists("1369436364973.png"):
dlnaCTT.focus()
click("1369436375230.png")
# Load 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
#
# 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
click("1370472404187.png")
#-------------------------------------------------------
# Launch the test run and sleep
#-------------------------------------------------------
#click("1370472473883.png")
# Sleep until well after test run has completed - 25mins
#sleep ( 25 * 60 )
# 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 )
# End - Launch a single test for testing purposes
#-------------------------------------------------------
# Save results and exit
#-------------------------------------------------------
# Save results
dlnaCTT.focus()
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()
click("1370544016236.png")
# Close CTT
dlnaCTT.focus()
click(Pattern("1370475354988.png").targetOffset(-15,-15))
# dlnaCTT.focus() DO NOT FOCUS
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>Utils.sikuli\Utils.sikuli</h2> <a href="Utils.sikuli\Utils.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">from</span> sikuli <span class="kw">import</span> *
<span class="kw">def</span> killAllTools():
killCtt()
<span class="kw">return</span>
<span class="kw">def</span> launchTaskManager():
<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">return</span>
<span class="kw">def</span> closeTaskManager():
<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>))
<span class="kw">return</span>
<span class="kw">def</span> killCtt():
launchTaskManager()
<span class="kw">if</span> exists(<img src="1370639797580.png" />):
<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" />)
closeTaskManager()
<span class="kw">return</span>
</pre>
</body>
</html>
from sikuli import *
def killAllTools():
killCtt()
return
def launchTaskManager():
click("1370638730338.png")
textBox = find("1370638755314.png")
textBox.type ( "taskmgr.exe" )
hover ( "1370638898178.png" )
click("1370638925410.png")
return
def closeTaskManager():
click(Pattern("1370639150858.png").targetOffset(-65,9))
click(Pattern("1370639198866.png").targetOffset(-8,24))
return
def killCtt():
launchTaskManager()
if exists("1370639797580.png"):
rightClick("1370639812491.png")
click("1370639665222.png")
click("1370639089876.png")
closeTaskManager()
return
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment