Hello,
My job consist in implement some tests to check softwares developped by my firm. For one of my soft there are many fields to check. For instance a field named 'Machine comments' has got some limits. To test them i would like,from a text file, copy a line of characters and send it to this field describe previously.
To give more details here is an example.
1 - The file is already create
Test.txt (name of the file)
line 1 - 012345678901234567890123456789 (numbers)
line 2 - '"'#{[|`\^@]]}&<>,;?:-_\=+*$��^'� (erratic characters...)
2- I launch my software (i know how to do)
3- I go the field described previously. (It works)
And i don't know how to copy the value of the line 1 in that field.
Here is a copy of the code.
;*******************************
;* RoboTask Task file &n bsp;*
;* Do not edit in text editor! *
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1003791194
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task6"
Hide=INTEGER|0
ID=INTEGER|1026759528
LocalVariables=STRING|"CHAMP_COMMENT"
LogOnAsUser=INTEGER|1
Name=STRING|"Test comment"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
[Actions\Action1]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER
[Actions\Action1\Params]
bottom=STRING|"272"
controlclass=STRING|"TBitBtn"
controltext=STRING|"Machine"
ctrltextexact=STRING|"0"
left=STRING|"260"
right=STRING|"388"
top=STRING|"244"
windowclass=STRING|"TFenetrePrincipale"
windowtext=STRING|"CVIPC 2000 - CVIC Valid"
wintextexact=STRING|"0"
x=STRING|"104"
y=STRING|"2"
[Actions\Action2]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click left button"
Params=FOLDER
[Actions\Action2\Params]
action=STRING|"0"
button=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action3\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"{TAB}"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action4]
ActionID=STRING|"A_VARIABLES_CREATE"
Enabled=INTEGER|-1
Name=STRING|"Create variable ""CHAMP_COMMENT"" with value ""0"""
Params=FOLDER
[Actions\Action4\Params]
expand=STRING|"0"
varname=STRING|"CHAMP_COMMENT"
varvalue=STRING|"0"
Well i hope i am clear enough for you.
Thanks in advance
How to write some characters in file
How to write some characters in file
Last edited by Oleg on Wed Mar 25, 2009 2:28 pm, edited 1 time in total.
How to write some characters in file
In order to read the line frome the text file use text loop.
For exaple:
Text Loop // from your text file
break
End loop
This loop will be broken after 1-st line. Thus the loop variable will contain the first line of your text.
For exaple:
Text Loop // from your text file
break
End loop
This loop will be broken after 1-st line. Thus the loop variable will contain the first line of your text.
Last edited by Oleg on Wed Mar 25, 2009 2:26 pm, edited 1 time in total.
How to write some characters in file
Hi Oleg,
Nice from you this quick answer to my request.
I tried the solution you suggested, but unfortunately it does not work like i want. Nothing from my txt file is copied in the specific of the program (named CVIPC.exe). But when i copy some characters found anywhere in a text file, it works. To resume it only works when i full the UserClipboard manually.
There is certainly something wrong but i don't find out what !
I remind you i only need the lines ( 4 lines with different characters) of my file "trame de test.txt" to be copied in a specific field of a program CVIPC.exe. I am sure it works but i don't know how to do.
i hope you will find a solution for me. this application is quiet important becuse once it works, i'll only have to duplicate it with a few modifications.
Here is another copy of my task
;*******************************
;* RoboTask Task file *
;* Do not edit in text editor! *
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1003791194
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task8"
Hide=INTEGER|0
ID=INTEGER|122135756
LocalVariables=STRING|"CHAMP_COMMENT"
LogOnAsUser=INTEGER|1
Name=STRING|"Copy of Test ""Commentaire"" bis"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""CVIPC.exe """
Params=FOLDER
[Actions\Action1\Params]
program=STRING|"C:\Georges Renault\CVIPC 2000\CVIPC.exe"
runas=STRING|"2"
wait=STRING|"0"
[Actions\Action10]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action10\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"{TAB}"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action11]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action11\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"^(V)"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2000 ms"
Params=FOLDER
[Actions\Action2\Params]
delay=STRING|"20"
[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value """""
Params=FOLDER
[Actions\Action3\Params]
expand=STRING|"0"
varname=STRING|"TXT"
[Actions\Action4]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER
[Actions\Action4\Params]
destvar=STRING|"C_LINE"
file=STRING|"C:\Documents and Settings\lleres\Mes documents\Trames de test.txt"
line0=STRING|"{ClipBoardContent}"
linecount=STRING|"1"
sourcetext=STRING|"0"
[Actions\Action5]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value ""{TXT} {C_LINE}"""
Params=FOLDER
[Actions\Action5\Params]
expand=STRING|"1"
varname=STRING|"TXT"
varvalue=STRING|"{TXT} {C_LINE}"
[Actions\Action6]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action8]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER
[Actions\Action8\Params]
bottom=STRING|"272"
controlclass=STRING|"TBitBtn"
controltext=STRING|"Machine"
ctrltextexact=STRING|"0"
left=STRING|"260"
right=STRING|"388"
top=STRING|"244"
windowclass=STRING|"TFenetrePrincipale"
windowtext=STRING|"CVIPC 2000"
wintextexact=STRING|"0"
x=STRING|"104"
y=STRING|"2"
[Actions\Action9]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click left button"
Params=FOLDER
[Actions\Action9\Params]
action=STRING|"0"
button=STRING|"0"
Friendly
Luc
Nice from you this quick answer to my request.
I tried the solution you suggested, but unfortunately it does not work like i want. Nothing from my txt file is copied in the specific of the program (named CVIPC.exe). But when i copy some characters found anywhere in a text file, it works. To resume it only works when i full the UserClipboard manually.
There is certainly something wrong but i don't find out what !
I remind you i only need the lines ( 4 lines with different characters) of my file "trame de test.txt" to be copied in a specific field of a program CVIPC.exe. I am sure it works but i don't know how to do.
i hope you will find a solution for me. this application is quiet important becuse once it works, i'll only have to duplicate it with a few modifications.
Here is another copy of my task
;*******************************
;* RoboTask Task file *
;* Do not edit in text editor! *
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1003791194
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task8"
Hide=INTEGER|0
ID=INTEGER|122135756
LocalVariables=STRING|"CHAMP_COMMENT"
LogOnAsUser=INTEGER|1
Name=STRING|"Copy of Test ""Commentaire"" bis"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""CVIPC.exe """
Params=FOLDER
[Actions\Action1\Params]
program=STRING|"C:\Georges Renault\CVIPC 2000\CVIPC.exe"
runas=STRING|"2"
wait=STRING|"0"
[Actions\Action10]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action10\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"{TAB}"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action11]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action11\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"^(V)"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2000 ms"
Params=FOLDER
[Actions\Action2\Params]
delay=STRING|"20"
[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value """""
Params=FOLDER
[Actions\Action3\Params]
expand=STRING|"0"
varname=STRING|"TXT"
[Actions\Action4]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER
[Actions\Action4\Params]
destvar=STRING|"C_LINE"
file=STRING|"C:\Documents and Settings\lleres\Mes documents\Trames de test.txt"
line0=STRING|"{ClipBoardContent}"
linecount=STRING|"1"
sourcetext=STRING|"0"
[Actions\Action5]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value ""{TXT} {C_LINE}"""
Params=FOLDER
[Actions\Action5\Params]
expand=STRING|"1"
varname=STRING|"TXT"
varvalue=STRING|"{TXT} {C_LINE}"
[Actions\Action6]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action7]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action8]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER
[Actions\Action8\Params]
bottom=STRING|"272"
controlclass=STRING|"TBitBtn"
controltext=STRING|"Machine"
ctrltextexact=STRING|"0"
left=STRING|"260"
right=STRING|"388"
top=STRING|"244"
windowclass=STRING|"TFenetrePrincipale"
windowtext=STRING|"CVIPC 2000"
wintextexact=STRING|"0"
x=STRING|"104"
y=STRING|"2"
[Actions\Action9]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click left button"
Params=FOLDER
[Actions\Action9\Params]
action=STRING|"0"
button=STRING|"0"
Friendly
Luc
How to write some characters in file
I saw your task. It's wrong
You try to paste from clipboard something (step 11), but you have put nothing into clipboard.
I think that you have to insert "Clipboard Put Text" instead of 5-th step (set variable value).
Or, maybe, after 5-th step.
see improved example below:
You try to paste from clipboard something (step 11), but you have put nothing into clipboard.
I think that you have to insert "Clipboard Put Text" instead of 5-th step (set variable value).
Or, maybe, after 5-th step.
see improved example below:
Code: Select all
;*******************************
;* RoboTask Task file
;* Do not edit in text editor!
;*******************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1380072790
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task765"
Hide=INTEGER|0
ID=INTEGER|1630367145
LocalVariables=STRING|"CHAMP_COMMENT"
LogOnAsUser=INTEGER|1
Name=STRING|"Copy of Test ""Commentaire"" bis"
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action10=FOLDER
Action11=FOLDER
Action12=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
Action7=FOLDER
Action8=FOLDER
Action9=FOLDER
[Actions\Action1]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""CVIPC.exe """
Params=FOLDER
[Actions\Action1\Params]
program=STRING|"C:\Georges Renault\CVIPC 2000\CVIPC.exe"
runas=STRING|"2"
wait=STRING|"0"
[Actions\Action10]
ActionID=STRING|"A_MOUSE_CLICK"
Enabled=INTEGER|-1
Name=STRING|"Click left button"
Params=FOLDER
[Actions\Action10\Params]
action=STRING|"0"
button=STRING|"0"
[Actions\Action11]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action11\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"{TAB}"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action12]
ActionID=STRING|"A_GENERAL_SENDKEYS"
Enabled=INTEGER|-1
Name=STRING|"Send keys to active window"
Params=FOLDER
[Actions\Action12\Params]
currentwindow=STRING|"1"
fixedwindow=STRING|"1"
keylayout=STRING|"0"
keys=STRING|"^(V)"
sendkind=STRING|"0"
wincaption=STRING|"Notepad"
[Actions\Action2]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 2000 ms"
Params=FOLDER
[Actions\Action2\Params]
delay=STRING|"20"
[Actions\Action3]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value """""
Params=FOLDER
[Actions\Action3\Params]
expand=STRING|"0"
varname=STRING|"TXT"
[Actions\Action4]
ActionID=STRING|"A_LOOP_TEXT"
Enabled=INTEGER|-1
Name=STRING|"Text Loop"
Params=FOLDER
[Actions\Action4\Params]
destvar=STRING|"C_LINE"
file=STRING|"C:\Documents and Settings\lleres\Mes documents\Trames de test.txt"
line0=STRING|"{ClipBoardContent}"
linecount=STRING|"1"
sourcetext=STRING|"0"
[Actions\Action5]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""TXT"" with value ""{TXT} {C_LINE}"""
Params=FOLDER
[Actions\Action5\Params]
expand=STRING|"1"
varname=STRING|"TXT"
varvalue=STRING|"{TXT} {C_LINE}"
[Actions\Action6]
ActionID=STRING|"A_CLIPBOARD_PUT"
Enabled=INTEGER|-1
Name=STRING|"Put Text"
Params=FOLDER
[Actions\Action6\Params]
file=STRING|"{TXT}"
linecount=STRING|"0"
sourcetext=STRING|"0"
[Actions\Action7]
ActionID=STRING|"A_LOOP_BREAK"
Enabled=INTEGER|-1
Name=STRING|"Break"
[Actions\Action8]
ActionID=STRING|"A_LOOP_END"
Enabled=INTEGER|-1
Name=STRING|"End Loop"
[Actions\Action9]
ActionID=STRING|"A_MOUSE_MOVETO"
Enabled=INTEGER|-1
Name=STRING|"Move To Object"
Params=FOLDER
[Actions\Action9\Params]
bottom=STRING|"272"
controlclass=STRING|"TBitBtn"
controltext=STRING|"Machine"
ctrltextexact=STRING|"0"
left=STRING|"260"
right=STRING|"388"
top=STRING|"244"
windowclass=STRING|"TFenetrePrincipale"
windowtext=STRING|"CVIPC 2000"
wintextexact=STRING|"0"
x=STRING|"104"
y=STRING|"2"
Last edited by Oleg on Sat Mar 28, 2009 7:10 am, edited 1 time in total.