- Регистрация
- 11.06.2013
- Сообщения
- 7
- Благодарностей
- 1
- Баллы
- 0
Hello,
I need to set value of file input control on page, I try SetValue, SetAttribute... but still don't know
Here is a code sample:
I need to set value of file input control on page, I try SetValue, SetAttribute... but still don't know
Here is a code sample:
Код:
// Event click [tag=input:file]
HtmlElement he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByName("uploaded_file");
if (he.IsVoid) {
he = instance.GetTabByAddress("page").GetDocumentByAddress("0").FindElementByAttribute("input:file", "fulltag", "input:file", "text", 0);
}
if (he.IsVoid) return -1;
// WHAT CODE GOES HERE TO SET VALUE ON FILE FOR EXAMPLE: c:\\1.txt
// I TRY THIS BUT DON'T KNOW WHAT NEXT
he.RiseEvent("click", instance.EmulationLevel); // - this open Dialog and I don't know how to set file path to this dialog
//he.SetValue("c:\\1.txt","Full",false);
//he.SetAttribute("value","c:\\1.txt");
//Emulator.SendText(instance.ActiveTab.Handle,"c:\\1.txt"); // I try this to send text on open dialog but now work