Account switiching problem

Asked by aaysh

Hi i wanna open another account of youlikehits.com (account switiching)
means after reaching this code 50 times their website throws an error that we cant view more website
so i want sikuli to open another account for me
As i am begginer in sikuli please provide me coding directly i would be very faithfull

Here is the total file
http://www.mediafire.com/?aak7ctpp39c3hax

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
RaiMan (raimund-hocke) said :
#1

Very optimistic, that anyone here solves the problem for you without any trial from your side and further information.

nevertheless some ideas:
- during your loop you have to check wether the error message has come up
- you have to insert some coding, that opens another account
- you have to navigate to the page, where you can continue or restart your loop.

BTW:

you code:

if exists ("visit-image.png"):
        click("visit-image..png")

better:

if exists ("visit-image.png"):
        click(getLastMatch())

so you just click on the thing you just found with exists() and do not need another search with another capture for the same image.

Revision history for this message
aaysh (aayushbagga11) said :
#2

i just need to know the code to change account when an message comes

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

Sorry, that is not possible without having at least a screen shot and some description of the manual process.

Revision history for this message
aaysh (aayushbagga11) said :
#4

The proccess is it should click logout
and then click on loggin
put username and pass

and again come in loop of opening websites 50 times then again switching to another account

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

users = (("user1", "password1"), ("user3", "password2"), ("user3", "password3"))

for user in users:
    login = find("yellowish-word-Login.png")
    click(login.getCenter().below(50))
    type(user[0])
    click(login.getCenter().below(90))
    type(user[0])
    click(login.getCenter().below(120))
    # some preparations for the following workflow
    # your looping

In your looping you have to either react on the error situation and switch back to the login page or you arrange your loop so the error cannot happen, because you logout before (e.g. after 45 turns). In any case this processing has to be in the above part "# your looping".

Hope it helps.

Revision history for this message
aaysh (aayushbagga11) said :
#6

in this code which is the main code to switch accounts
users = (("user1", "password1"), ("user3", "password2"), ("user3", "password3"))

for user in users:
    login = find("yellowish-word-Login.png")
    click(login.getCenter().below(50))
    type(user[0])
    click(login.getCenter().below(90))
    type(user[0])
    click(login.getCenter().below(120))

i mean this code will give sikuli my user id and pass
which code is used to switch accounts
and in proper order and how sikuli will know which account is open

can u create a proper example with this code as i am newbie i am not that good with sikuli

this is the code i wanna integrate it with
for m in range(45): ------------> so that error wont occur
    if exists ( ):
        click( )
        sleep(2)
    else:
        click( )
    sleep(42)
    rightClick( )
    sleep(3)
    click( )
    sleep(5)
    click( )
    sleep(2)
    click( )
    sleep(5)

please provide code i would be very thankfull

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

Sorry, that is not possible for me - costs too much time. Too much application specific.

You have to find out manually what to do and then turn it into a script. Nothing else have you done with your snippet you have already.

If you start something new, you are always a newbie - everywhere.

But if you expect to get help, you have to invest some time to learn and try.

Come back if your solution does not work. I will have a look at it definitely.

BTW: your information is not "given to Sikuli". It is your script, that might contain some personal information and it is up to you, how you secure this script.

Revision history for this message
aaysh (aayushbagga11) said :
#8

Then please
just tell me which code is used to switch account

users = (("user1", "password1"), ("user3", "password2"), ("user3", "password3"))

to input accounts

now a/c 1 is open and i wanna tell sikuli after completing loop go to account2

please provide code for this

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

All I can do for you is written in comment #5

you have to put your "for m in range(45):" loop as inner loop at # your looping.

and you have to assure, that you start with the login page and get there again after your loop ends.

Can you help with this problem?

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

To post a message you must log in.