Commit 3d5bd615 authored by wwalkowski's avatar wwalkowski

changes to Sikuli scripts

parent c5bac8e9
......@@ -70,21 +70,59 @@
<h2>sikuli-sikuli.sikuli\sikuli-sikuli.sikuli</h2> <a href="sikuli-sikuli.sikuli\sikuli-sikuli.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">import</span> datetime
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"A) Double clicking icon - "</span>, qwerty
logfile.close()
<span class="skw">doubleClick</span>(<img src="1351200527344.png" />)
<span class="skw">wait</span>(<img src="mnncttsikuli.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"B) Clicking play - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="1351200799067.png" />)
<span class="cmt">#sleep ( 1200 )
</span>
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"C) Sleeping 1080 - "</span>, qwerty
logfile.close()
<span class="cmt"># 18 minutes
</span><span class="skw">sleep</span> ( <span class="dig">1080</span> )
<span class="skw">wait</span> ( <img src="r930unnnctts.png" />, <span class="dig">3600</span> )
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"D) Double clicking title bar - "</span>, qwerty
logfile.close()
<span class="skw">doubleClick</span>(<img src="r930unnnctts.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"E) Clicking File - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="File.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"F) Clicking quit - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Quit.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"G) Done - "</span>, qwerty
logfile.close()
</pre>
</body>
</html>
import datetime
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "A) Double clicking icon - ", qwerty
logfile.close()
doubleClick("1351200527344.png")
wait("mnncttsikuli.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "B) Clicking play - ", qwerty
logfile.close()
click("1351200799067.png")
#sleep ( 1200 )
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "C) Sleeping 1080 - ", qwerty
logfile.close()
# 18 minutes
sleep ( 1080 )
wait ( "r930unnnctts.png", 3600 )
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "D) Double clicking title bar - ", qwerty
logfile.close()
doubleClick("r930unnnctts.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "E) Clicking File - ", qwerty
logfile.close()
click("File.png")
click("Quit.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "F) Clicking quit - ", qwerty
logfile.close()
click("Quit.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "G) Done - ", qwerty
logfile.close()
......@@ -70,6 +70,8 @@
<h2>upnp ctt.sikuli\upnp ctt.sikuli</h2> <a href="upnp ctt.sikuli\upnp ctt.zip">(Download this script)</a>
</div>
<pre class="sikuli-code">
<span class="kw">import</span> datetime
<span class="cmt"># Launch app
</span>upnpCttApp = App(<span class="str">"C:\Program Files (x86)\UPnP Certification Test Tool 2.0\UCTT2.0.exe"</span>)
upnpCttApp.open()
......@@ -80,40 +82,144 @@ upnpCttApp.open()
</span>
<span class="cmt">#type("x")
</span>
<span class="cmt"># sleep 60 seconds to let the app launch
</span><span class="skw">sleep</span>(<span class="dig">60</span>)
<span class="cmt"># sleep 15 seconds to let the app launch
</span>logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"1 sleeping 15 seconds - "</span>, qwerty
logfile.close()
<span class="skw">sleep</span>(<span class="dig">15</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"2 Clicking file - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="File-1.png" />)
<span class="skw">wait</span>(<img src="Salad.png" />, <span class="dig">300</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"3 Waiting for Select - "</span>, qwerty
logfile.close()
<span class="skw">wait</span>(<img src="Salad.png" />, <span class="dig">900</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"4 Clicking Select - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Salad.png" />)
<span class="skw">wait</span>(<img src="DUTSelection.png" />, <span class="dig">60</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"5 Waiting for DUT Selection - "</span>, qwerty
logfile.close()
<span class="skw">wait</span>(<img src="DUTSelection.png" />, <span class="dig">900</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"6 Waiting for OCAP Device - "</span>, qwerty
logfile.close()
<span class="skw">wait</span>(<img src="EICAPDevice.png" />, <span class="dig">900</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"7 Clicking OCAP Device - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="EICAPDevice.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"8 Waiting to load test file - "</span>, qwerty
logfile.close()
<span class="cmt"># Wait up to 5 minutes for the Loading Test File to go away
</span><span class="skw">wait</span>(<img src="Next-2.png" />, <span class="dig">300</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"9 Clicking next - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Next.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"10 Clicking next - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Next-1.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"11 Clicking Play - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="1351034006941.png" />)
<span class="cmt"># log time going to sleep
</span>logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"12 Sleep 900 - "</span>, qwerty
logfile.close()
<span class="cmt"># sleep until after the tool is done to avoid false readings of the screen
</span><span class="skw">sleep</span> (<span class="dig">1200</span>)
</span><span class="skw">sleep</span> (<span class="dig">900</span>)
<span class="cmt"># get timestamp so we know when it woke back up again
</span>logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"13 Waiting for ion stopped - "</span>, qwerty
logfile.close()
<span class="skw">wait</span>(<img src="iunstunned.png" />, <span class="dig">300</span>)
<span class="skw">wait</span>(<img src="iunstunned.png" />, <span class="dig">1800</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"14 Clicking Save button - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="1351032389057.png" />)
textBox = <span class="skw">wait</span>(<img src="Filename.png" />, <span class="dig">300</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"15 Entering name of results file - "</span>, qwerty
logfile.close()
textBox.<span class="skw">type</span>(<span class="str">"C:\upnpCttTestResults.uctt"</span>)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"16 Clicking Save- "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Save.png" />)
<span class="cmt">#click ( "Yes.png" )
</span><span class="skw">sleep</span> ( <span class="dig">5</span> )
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"17 Clicking File - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="File-1.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"18 Clicking exit - "</span>, qwerty
logfile.close()
<span class="skw">click</span>(<img src="Exit.png" />)
logfile = open(<span class="str">'C:\sikuliLog.txt'</span>, <span class="str">'a'</span>)
qwerty = datetime.datetime.now()
<span class="kw">print</span> &gt;&gt; logfile, <span class="str">"19 Done - "</span>, qwerty
logfile.close()
</pre>
</body>
</html>
import datetime
# Launch app
upnpCttApp = App("C:\Program Files (x86)\UPnP Certification Test Tool 2.0\UCTT2.0.exe")
upnpCttApp.open()
......@@ -8,37 +10,141 @@ upnpCttApp.open()
#type("x")
# sleep 60 seconds to let the app launch
sleep(60)
# sleep 15 seconds to let the app launch
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "1 sleeping 15 seconds - ", qwerty
logfile.close()
sleep(15)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "2 Clicking file - ", qwerty
logfile.close()
click("File-1.png")
wait("Salad.png", 300)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "3 Waiting for Select - ", qwerty
logfile.close()
wait("Salad.png", 900)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "4 Clicking Select - ", qwerty
logfile.close()
click("Salad.png")
wait("DUTSelection.png", 60)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "5 Waiting for DUT Selection - ", qwerty
logfile.close()
wait("DUTSelection.png", 900)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "6 Waiting for OCAP Device - ", qwerty
logfile.close()
wait("EICAPDevice.png", 900)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "7 Clicking OCAP Device - ", qwerty
logfile.close()
click("EICAPDevice.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "8 Waiting to load test file - ", qwerty
logfile.close()
# Wait up to 5 minutes for the Loading Test File to go away
wait("Next-2.png", 300)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "9 Clicking next - ", qwerty
logfile.close()
click("Next.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "10 Clicking next - ", qwerty
logfile.close()
click("Next-1.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "11 Clicking Play - ", qwerty
logfile.close()
click("1351034006941.png")
# log time going to sleep
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "12 Sleep 900 - ", qwerty
logfile.close()
# sleep until after the tool is done to avoid false readings of the screen
sleep (1200)
sleep (900)
# get timestamp so we know when it woke back up again
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "13 Waiting for ion stopped - ", qwerty
logfile.close()
wait("iunstunned.png", 300)
wait("iunstunned.png", 1800)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "14 Clicking Save button - ", qwerty
logfile.close()
click("1351032389057.png")
textBox = wait("Filename.png", 300)
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "15 Entering name of results file - ", qwerty
logfile.close()
textBox.type("C:\upnpCttTestResults.uctt")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "16 Clicking Save- ", qwerty
logfile.close()
click("Save.png")
#click ( "Yes.png" )
sleep ( 5 )
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "17 Clicking File - ", qwerty
logfile.close()
click("File-1.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "18 Clicking exit - ", qwerty
logfile.close()
click("Exit.png")
logfile = open('C:\sikuliLog.txt', 'a')
qwerty = datetime.datetime.now()
print >> logfile, "19 Done - ", qwerty
logfile.close()
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