Ajax check

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
Hi, I want to make an account creator for dynamic ajax forms. This forms for example tell you if username is available before submitting, for example youtube account registration form.

On some sites firns change some form´s css property on others it writes a sentence.


So I want to check this dynamic forms and be able to correct fields before submitting
so I don't waste captcha service credit if account is not being created.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
You can put a pause after username input. That way the ajax has time to load. Then do a Presence of Selected Text check by highlighting the text (username available) then right-clicking and select the presence of selected text. It will put a javascript IF statement in your template. If the text is there the template will carry on. If not, you can put another step off to the side and put a macro in there. I just use a Counter step. Double click the red button on your Javascript if step and double click on the blue button on your macro. Then point that back up to fill in a new username. Or, like in yahoo, instead of putting a macro step, you could select one of the usernames that they offer by selecting it when recording your template. If you need example, let me know.
 
  • Спасибо
Реакции: goodposter

johnmay5

Client
Регистрация
10.04.2011
Сообщения
83
Благодарностей
5
Баллы
8
Hi bigcajones,

Could you pls give an example of this java field.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
  • Спасибо
Реакции: goodposter и dusk

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
This sounds good but, by the way do you know how to do that if the form change is a css property for example if the div containing the field changes color?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
What site are you trying to do? I would need to see an example.
 

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
Hey, I'm trying to follow your instructions let me see if I can undestand them, I was mistaken with the css, I meant javascript.

This part i dont understand

I just use a Counter step. Double click the red button on your Javascript if step and double click on the blue button on your macro. Then point that back up to fill in a new username. Or, like in yahoo, instead of putting a macro step, you could select one of the usernames that they offer by selecting it when recording your template. If you need example, let me know.

do the color matter?
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Did you look at the template I provided?

There are two ways to handle the situation. Either loop back up and put in new username or click on one of the names offered.

The Counter Macro is just a way to get out of the continuation of the template so that you can go back to username step. This will work on most sites. Yahoo and Hotmail offer you an alternative email. When recording your template, put in a username that you know that you've already used. In Yahoo, press the check button. You will see the words 'Id is not available'. Highlight that text, right-click and in the dropdown select 'Create Selected Presence Check'. Then you will right-click on one of the usernames that they give you, select 'To Branch Builder' in your drop down. Select 'Rize' and in the dropdown 'Click' and then 'Add to template'.

Here I'll give you the two examples using yahoo.

Посмотреть вложение Choose New Username.xml

Посмотреть вложение Loop To Put In New Username.xml
 

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
Hi, Follow up the process you taught me and here is the problem. If the template starts and the username is available the first time the in continues till end with no problems. If theusername is taken it loops and gets new usernames but when the username is ok, it continues looping!

here is the template if you can check http://www.megaupload.com/?d=63HIK9HS
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Okay goodposter, I took a look at the site and here's what I would do. I didn't get the spanish page like you do, but I believe this will still work. If you put in a username that isn't available, has the wrong syntax then you should get an error message. I would do a check for the error messages instead of checking for a good username. In your text view of the dom of the page you will find the error messages that will be displayed. Here it is on the english version:

Код:
if ( ! /^[0-9A-Za-z_]{3,16}$/.test(userName) ) {

		    errorMsg = "Your username must be numbers, letters & underscores only and must be at least 3 characters long.";

		} else if ( (userName).charAt(0)=='_' || (userName).charAt(userName.length-1)  =='_') {

            errorMsg = "Your username can not begin or end with an underscore (_). Please try again.";

		} else if (data == "false" ) {

            errorMsg = "The username you have entered is not available. Please try again.";

        }
You can check for presence of the selected text error messages and then if true, go back to the username field. You should put a pause between the steps to make sure the JS loads before checking. As soon as I can find some spanish proxies I'll try to write it up for you.
 

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
Hey how are you men, thanks for the prompt response.

If you look right to the template, you sill see that what I did was that indeed, if the error message (to me in spanish) shows up I do a presence check and for success I go back and for not success i continue, I only check for the not available error because all the names all entered from file so there is no chance for typo or bad characters.

But what was happening was this. if you run the template in debug mode, and the first time you get a good username the tempalte goes to the end ok. But if the first time you get a bad username it will loop to get another as intended, but when the good one appears it fails it continues looping forever no matter what. Is like if the presence check gives error all the way, if you see the logs the presence checks empty, but not finding anything the check gives the same response as before I think, so this is way I am trying to figure out. I think that maybe the if could compare to empty?

Thank you indeed, maybe if you try to do the template in english I can correct that for spanish!

http://proxys.com.ar/ here you may get some spanish country proxies, like spain or mexico

Thanks in advance men
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
This site's a bitch. I worked on it for 2 hours and couldn't get it to work right. The problem is the Javascript on the page is always there for successful and non-successful username. I even tried using the image urls and values but the same thing. They are both on the dom of the page and source of the page.

The only thing I can suggest is that you use very unique usernames that won't throw an error.

Sorry, I tried everything, but no success.
 
  • Спасибо
Реакции: goodposter

goodposter

Client
Регистрация
20.04.2011
Сообщения
19
Благодарностей
0
Баллы
0
Yeap, I you are right but 2 solutions come to mind, first I my try to get the ajax response with a branch step, or second I may capture a screenshot and compare.

First I have done with perl on other bots, lets see if zeeno is up to the task.

Edit:

Ok I debug it with firebug ad get where the information is running agains via ajax and what it sends back is a true or false statement that then is checked by client side ajax to show the message. Lets see if Zenno can get this response too and solve the problem :-)
 

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