How to read text from notepad and type in form without Enter key

Asked by priyankap on 2017-09-13

I have a form with 3 fields to enter. Create a notepad with a value.
File is read and the value is stored in variable
Example-value in notepad is Hello
Using the command type(var)
When script is run then form opens and value is typed such that Hello#Enter

How to avoid the same so as to make the script write Hello only

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
TestMechanic
Solved:
2017-09-14
Last query:
2017-09-14
Last reply:
2017-09-13
Best TestMechanic (ndinev) said : #1

Not sure from where you are reading the values
In python you can just do

with open(fname) as f:
    content = f.readlines()
# you may also want to remove whitespace characters like `\n` at the end of each line
content = [x.strip() for x in content]

priyankap (priyankap) said : #2

Thanks x.strip() helped me solve the problem