|
Post by kumarke on Jun 29, 2017 6:40:38 GMT
Hi
I am trying to enter username and password and trying to do so by storing the text into variables and execute them through a loop. Is it possible
|
|
|
Post by AnkuLua on Jun 29, 2017 9:30:40 GMT
|
|
|
Post by kumarke on Jun 29, 2017 17:39:21 GMT
thank you
|
|
|
Post by kumarke on Jun 29, 2017 19:01:17 GMT
Hi,
I am trying to enter userid and password in two different locations and i have about 50 each and may increase. I am trying to use something like this
for userid
line.1= userid1 line.2= userid2 . . . line.50 = userid50 and similarly for pwd
pwd.1=pwd1 pwd.2=pwd2 and so on
then i tried this
for i=1,50,1 do Location(x1,y1) type(line.i) location(x2,y2) type(pwd.i)
however it doesnt work. please help. Thanks in advance
|
|
|
Post by AnkuLua on Jun 29, 2017 22:16:55 GMT
EDITED
line = {} pwd = {} line[1]= "userid1" line[2]= "userid2" . . . line[50] = "userid50" and similarly for pwd
pwd[1]="pwd1" pwd[2]="pwd2" and so on
for i=1,50 do click(Location(x1,y1)) type(line) click(Location(x2,y2)) type(pwd) end
|
|
|
Post by kumarke on Jun 30, 2017 3:31:04 GMT
line[1]= userid1 line[2]= userid2 . . . line[50] = userid50 and similarly for pwd pwd[1]=pwd1 pwd[2]=pwd2 and so on for i=1,50 do click(Location(x1,y1)) type(line ) click(Location(x2,y2)) type(pwd) end
Thank you for the prompt reply but that doesnt work. It returns this error "attempt to index global 'line' (a nil value)
|
|
|
Post by AnkuLua on Jun 30, 2017 3:59:12 GMT
added following in front of everything
line = {} pwd = {}
|
|
|
Post by kumarke on Jun 30, 2017 5:58:06 GMT
added following in front of everything line = {} pwd = {} You nean before line[1], I add line={} and pwd one before pwd? I tried that too but it still returns the same error. Is it because the values I am giving in line is a string? I mean line[1]="abc" is what I have and similarly for pwd too
|
|
|
Post by AnkuLua on Jun 30, 2017 6:08:43 GMT
it should look like
line = {} pwd = {} line[1] = "user1" line[2] = "user2"
pwd[1] = "pwd1" pwd[2] = "pwd2"
for i=1,50 do click(Location(x1,y1)) type(line) -- missing this before click(Location(x2,y2)) type(pwd) -- missing this before end
|
|
|
Post by kumarke on Jun 30, 2017 14:02:04 GMT
I did that too but still it says invalid method
|
|
|
Post by Mercobots on Jun 30, 2017 15:50:28 GMT
I did that too but still it says invalid method try this line = {} pwd = {} line[1] = "user1" line[2] = "user2"
pwd[1] = "pwd1" pwd[2] = "pwd2"
for i = 1, 2 do type(Location(x1, y1),line[i]) type(Location(x2, y2),pwd[i]) end
|
|
|
Post by kumarke on Jul 3, 2017 18:40:55 GMT
Thank you I tried that too but the problem is still persisting. however i did something else and it worked. I did everything as you suggested such as line = {} pwd = {} line[1] = "user1" line[2] = "user2"
pwd[1] = "pwd1" pwd[2] = "pwd2"
however i changed the code a bit as below
a=line b=pwd type(a) type(b)
works like a charm
thank you
|
|