Questions on filling up a web form for "first name" and "last name" from a text file!

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
1. I'm trying to fill up a web form for "first name" and "last name" from a file (names.txt) which has following text:

james:blunt
eric:clapton
john:denver
will:smith

The problem is that when a random "first name" is selected by the system, say, "james" then "last name" should be "blunt" which is subsequent to it but the system is selecting any random "last name". How should I make that when system selects a random "first name" then it must select the "last name" following it. If the "first name" is "james" then "last name" must be "blunt" also as shown in the names.txt file.

2. I also want that, suppose a name (first and last) has already been selected/used from the file (names.txt) while filling up the web form. Now I don't want that same name (first and last) to be used again in the same web form. Is this possible? i.e. telling ZennoPoster not to use names (first and last) which has been already used?

3. Does ZennoPoster uses "IF" clause while filling up the web form? Suppose I'm registering an email account in yahoo, and "IF" the username had already been registered, then can ZennoPoster try to remove the previous username and try with a new username to check if it is available. And after checking few times, if a username is availabe then ZennoPoster continues to go with further steps of registration. OR, say, "IF" the ZennoPoster finds the username is available in the first attempt then continues with the registration. Can it be done in the same template?

Well! I'm not a programmer and I would like to know if I'll be able to do this as it sounds as a complex task.

Thanks
apeee
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113
1. See following template:

Посмотреть вложение splitstring.xml

2. You can make backup copy of names.txt and when you pull string, set true to delete string from file. That way the first name and last will not be used again.

3. You will have to parse text on page to see if 'username not available' text is on page. If so, make a loop to put in new usename. Best way is to append a random number to end of username when signing up. If you need help I'll show you.
 
  • Спасибо
Реакции: apeee

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
@bigcajones Thank you!

I uploaded splitstring.xml to ProjectMaker but I didn't understand what is happening and how you did it.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113
The first StepBranch pulls the line that contains the first:last from the file names.txt randomly.

Second stepbranch splits the resulting string and pulls the first element which is first name.

Third stepbranch splits the resulting string and pulls the second element which is last name.
 

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
Now I understood what you did.

Step 1. Get one line "first:last" randomly from names.txt
Step 2. Split the line to get "first string" from step 1.
Step 3. Split the line to get "second string" from step 1.

Earlier, I was pulling one line randomly from names.txt and then directly went to split it. I didn't create step branch for each step. So that was the problem. After several testing I found 3 working ways to do this and was able to solve my problem 1 and 2.

But I still didn't find solution for problem no. 3.

3. Does ZennoPoster uses "IF" clause while filling up the web form? Suppose I'm registering an email account in yahoo, and "IF" the username had already been registered, then can ZennoPoster try to remove the previous username and try with a new username to check if it is available. And after checking few times, if a username is availabe then ZennoPoster continues to go with further steps of registration. OR, say, "IF" the ZennoPoster finds the username is available in the first attempt then continues with the registration. Can it be done in the same template?

One more question:

4. I didn't understand what 3 dots (blue, green and red) and 3 actions (set, get and rise) means and do?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113
3. Yes you can do it. When signing up for sites usually a little javascript will come up and say username is not available. You will want to before clicking the signup button:
Get-->Webrowser-->Get dom text of page-->Parameters-->This\ username\ not\ available (or whatever the page says)

Set-->Logic Operation-->'{Result of above(Step Branch Id)}'!='' (that's double apostrophe-not quote)

If the Step Branch returns false double click the failed execution (red button) send it to the Signup button. If it comes back true (green button), double click it and send it back up to fill out the username again. Like I said, you will get the best success if you a: put a random number behind the username or b: use the random text macro to assign a username. You'll be saving it anyways.

Blue dot: enter the step branch from somewhere else. When you are recording and your step branches are joined together, this is the same thing.

Green dot: successful step branch exit. If your Step branch executes properly, this is where you double click to send it to the next step.

Red dot: failed step branch exit. If your Step branch doesn't execute properly (like the example above in your username question) you would send the branch to somewhere else. Just double click it and double click the blue button on the step branch you want it to go to:
 
  • Спасибо
Реакции: apeee

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
1. Made a "Step Branch" with "Get" and "Web Browser" with "Get DOM text of the page".
2. Made a "Step Branch" with "Get" and "Macros" and went to "Macros Builder" --> "Regular Expression" --> "Parse with Regular Expression" and in "The input string" put the result of "step 1" and in "The regular expression" put the "regular expression value" which I got from "regular expression builder" which has the result "This ID is not available".

(Is the above two step correct?)

3. Made a "Step Branch" with "Get" and "Macros" and went to "Macros Builder" --> "Personal data" --> "First name" and copied the "macros" and paste it in the "macros"

I connected (green to blue) the "username check button" to step 1. And connected (green to blue) the "step 3" to "username text box". But it didn't worked. And I have run out of ideas on what to do now. I'm confused at this step. What should I use Set/Get and Macros/Logic Operation. And what value should be used and where to put it? Any suggestions?

I have attached the template file which does the actions described above.

Посмотреть вложение duplicate-username-test.xml
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
The username which you are using in this IdNotAvailable.xml template is FirstName+LastName+NumbersBetween10-9999, which is very unique, so every time when ZennoPoster clicks on "username check button" it never shows "This ID is not available" during Debug (because that username is always available), so I was not able to check whether ZennoPoster creates "new username" when "This ID is not available" comes up.

So, to test this, I edited username field with only "FirstName", and when ZennoPoster clicked on "username check button" during Debug, "This ID is not available" came up. So, I further clicked on "Next" button several times but a "new username was not created" and rather ZennoPoster went to click on "Create My Account" button for registration.

So, there might be a bug in your template. Can you please check it.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113
Here apeee, I fixed it so that it works now. Try it!


Посмотреть вложение IdNotAvailable2.xml

Hope this helps. I should have put it in the template when I was recording it. This is an older template so I just appended it. I don't have much problems with the username not being unique the way I do the username macro.
 
  • Спасибо
Реакции: apeee

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
It's working now.

I understand now that what you are doing.

Step A: Setting a "Step Branch" with "Get" and "WebBrowser" with "Get page text" and having parameter as "This\ ID\ is\ not\ available". But I have a few questions for this step:

1. Why didn't you used "Get DOM text of the page" or "Get source of the page"?
2. What is the difference between "Get DOM text of the page" and "Get page text"?
3. Why are you using "\" backslash in "This\ ID\ is\ not\ available"? Why not just "This ID is not available"?

Step B: Setting a "Step Branch" with "Set" and "Logic Operation" and putting the result of "step 1" between code like this:

Код:
'step 1 result'!=''
in "Expression (js). But I have a few questions for this step also:

1. What is 'step 1 result'!= code doing?
2. Why is this "step branch" doing/required?

And also, I have one more question:

In "debug" when I continuously click on next button very fast, "This ID is not available" gets ignores and ZennoPoster goes to next step for registration even though the username is not available. I know there is a way to add pause from macros builder (Work with template --> Pause) but where should I keep it, so that website/script gets enough time to check for availability of username after clicking on "username check button". Or, is there any other method to make website wait for some seconds after a certain step?

And sometimes, the "username check button" is not clicked at all? Why is that happening? Any solutions.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
682
Баллы
113
A.

1. You only need to get page text because you are not looking for anything other than text. If you were looking for div tags or html tags then you would need to use get dom text. Getting text is faster than getting dom text. Dom text is the contexual element of something. If you were looking for something that has a certain length in characters or a size of a picture you need to use dom text. Source text is what browsers use to show the elements. It is the text used to translate the web page into the web browser translation.

2. I don't know unless it has something to do with ZP's built in regex engine. If you right click on a text element and select 'created selected text presence check' this is what it puts into template. Might have to ask Nauru about that one. I just know that it works. When you do the check for selected text in you action recording on the page, it automatically sets up a logic operation in the template editor. I just copied that to get the '!=' thing. Again, don't know how it works cuz in javascript I think this means not equal to but it works for checking presence of text. Gives you either true or false and you branch off from there.

I would put a pause in between where you input username and the check for available step. As far as the username check button not being clicked, I believe that if the username is unique enough and the page reads that, it won't put up the check button.
 
  • Спасибо
Реакции: apeee

apeee

Новичок
Регистрация
23.05.2011
Сообщения
22
Благодарностей
1
Баллы
0
I thought you were manually doing it, now it make sense. Now I understand on how to use 3 dots.

Thank you for your help.

Is there a way to make captcha retry 3-5 times if there is a failed captcha?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)