Changing settings on mutiple GUIs

Asked by Michael W

We are looking at Sikuli to help us automate some GUI changes on several identical interfaces. We have an excel spreadsheet with a list of IP addresses. What we want to do is set up a script to login to the GUI navigate to a settings page, change some of the settings, save and proceed to the next IP address on the list. I have been working on a script to do one page but I do not know how to get Sikuli to take the next IP address from my excel doc.

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Michael W (mcwaltertx) said :
#1

Update on this question. We have one GUI setting that can be set to 6 possible settings. We want to change it to a standard setting for all devices. Here is the script I have. On step 2 the GUI setting can be one of 6 settings. How do I get sikuli to find the setting shown and skip the other 5 setting choices? The "or" command doesnt do it.

find("Preset-1.png")
rightClick(Pattern("Preset-2.png").similar(0.90).targetOffset(106,1)) or rightClick(Pattern("Preset-3.png").similar(0.97).targetOffset(112,-1)) or rightClick(Pattern("Preset-4.png").similar(0.95).targetOffset(110,-1)) or rightClick(Pattern("PresetOutdoo.png").similar(0.80).targetOffset(100,0)) or rightClick(Pattern("Preset-5.png").targetOffset(107,0)) or rightClick(Pattern("Preset-6.png").similar(0.80).targetOffset(100,-2))
type("O\t")
type("N\t")
type("N\t")
type("N\t")
type("N\t")
wheel(WHEEL_DOWN,2)
click("1346791944447.png")

Revision history for this message
Michael W (mcwaltertx) said :
#2

OK so i fixed my problem with the presets but I am still searching for the best way to change the IP address from an excel page. Any advice on that point is appreciated.

openApp("C:\Program Files (x86)\Internet Explorer\iexplore.exe")
rightClick("1346788900412.png")
click("Delete") # to clear off the https line
type("1346781791250.png", "https://192.168.x.x\r")
click("Continuetoth.png")
wait(3)
type("user\t")
type("password\r")
wait (10)
click(Pattern("mscieoiizVid.png").targetOffset(105,-2)) # select setting above presets
type("\t") # tab to next preset
type("O\t") # set to outdoor
type("N\t") # set to normal
type("N\t") # set to normal
type("N\t") # set to normal
type("N\t") # set to normal
wheel(WHEEL_DOWN,2)
click("1346791944447.png") # to save config changes
wait (10)
wheel(WHEEL_DOWN,2)
click("1346791944447.png") # to save config changes
wait (10)

Revision history for this message
RaiMan (raimund-hocke) said :
#3

--1. make a csv-file
this can be read without any additional modules directly via standard Python I/O

--2. use xlrd
If you want to stick with your XLS, there is a Python module available, that can be used with Sikuli (plain Python).
Google: xlrd ;-) and look for many questions here on this.

Revision history for this message
Michael W (mcwaltertx) said :
#4

Ok so if I use a csv what are the commands in Sikuli to run my script on each IP address on the list? I am reading the guide as well.

Thanks for the help :)

Revision history for this message
RaiMan (raimund-hocke) said :
#5

the basics:

if your file looks like this (addresses.txt)
192.168.0.1
192.168.0.2
192.168.0.3
192.168.0.4

read the ip's into a list

f = open("path-to-addresses.txt
ips = []
for line in f.readlines():
    ips.append(line.strip())
f. close()

for ip in ips:
    print ip # or your code to fill in the ip somewhere

the rest is standard Python scripting according to your needs.

Can you help with this problem?

Provide an answer of your own, or ask Michael W for more information if necessary.

To post a message you must log in.