Field Is Not Filled In Debug

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Since like many here I'm new to C# and the CodeCreator program I'm trying to figure out how to make the templates work right. I've recorded a template in PM and it works fine. I made a new template in CodeCreator and the form fields are not filled out. I would like to learn how to do this as I like a challenge. Here's what I'm looking at:

Код:
// Executing macros
			he.SetValue(instance.RiseMacros("String.Split", new [] { "", "File.GetString", "\\Resources\\email.txt", "0", "false", "", ":", "1" }), true);

			// Setting value [{-String.S...] to the element with tag [input:password]
			he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("passwordconfirm");
			if (he.IsVoid) {
				he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("input:password", "fulltag", "input:password", "text", 1);
			}
			if (he.IsVoid) return -1;
Doesn't put anything in the field when debugged.
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
Hello? HB? Step85? Anybody?
 

Hungry Bulldozer

Moderator
Регистрация
12.01.2011
Сообщения
3 441
Благодарностей
834
Баллы
113
Hey,

Firstly you should find element on the page and only then set value, at the moment it seems back to front.
We should find element by some search criteria:
PHP:
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByName("Email"); //first search criteria
if (he.IsVoid) {
		he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildById("Email");//2nd search criteria
}
if (he.IsVoid) {
                he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByTag("form", 0).FindChildByAttribute("input:text", "fulltag", "input:text", "text", 0); //3th search criteria
}
if (he.IsVoid) return -1;  //if nothing was found
And only when element is found (filed for password input) we set value there:

PHP:
he.SetValue(instance.RiseMacros("File.GetString", new [] { "\Results\emails.txt", "0", "False" }), true);
 

bigcajones

Client
Регистрация
09.02.2011
Сообщения
1 216
Благодарностей
683
Баллы
113
I just recorded my actions just like in PM. I didn't write the code. Is Code Creator doing this? Maybe I copied the wrong steps to show you, but all I did was record the actions, then ran in in debug and it didn't fill out the username or any password information. I'll try again and if it doesn't work, I'll send you a copy of the project. Thanks for your help.
 

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