← Back to team overview

sikuli-driver team mailing list archive

[Question #189827]: Reading and writing file query

 

New question #189827 on Sikuli:
https://answers.launchpad.net/sikuli/+question/189827

Hi Raiman,

I am tring to genarate reports using sikuli, for that i am reading the input from the notepad (("C:\ccccc\login.txt","r") and then i am feeding in to the test boxes to my screen.And then if the login is succesful (if it shows the next screen) i need to write the "login is successful" in the same note pad where i am feeding the input.the below code which i have wriiten for this case.

find("1331025509166.png")
click("AY7.png");wait(5)
import array
arr=[]
f=open("C:\ccccc\login.txt","r")
#f.read()
for line in f.readlines():
    arr.append(line)
#f.close()
find(Pattern("1329984936713.png").targetOffset(104,29));wait(1)
click(Pattern("1329984936713.png").targetOffset(104,29))
type(arr[0])
wait(1)
find("Fusswurd.png");wait(1)
click(Pattern("1329985178218.png").targetOffset(95,30))
type(arr[1])
click("Login.png")
f=open("C:\cccccc\login.txt","w+")
f.write("Login is successful")
f.close()

the outpuut of the above script results that it delete the input which i am feeedig and its writing as "login is successful"alone in the notepad, what i needed is suppose input which i am giving as

123          login is sucessful # should be written in the same note pad which i am feeding input
123          

the notepad should contains as above.please assist me on this.
Whether the above scenario can be done in excel if so please advice me.
Awaiting for your valuable response.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.