c# - How to fill in username and password using DotNetBrowser -
public mainwindow() { initializecomponent(); browserview webview = new wpfbrowserview(); mainlayout.children.add((uielement)webview.getcomponent()); manualresetevent waitevent = new manualresetevent(false); webview.browser.finishloadingframeevent += delegate (object sender, finishloadingeventargs e) { if (e.ismainframe) { waitevent.set(); } }; webview.browser.loadurl("https://console.api.ai/api-client/#/login"); waitevent.waitone(); domdocument document = webview.browser.getdocument(); domelement username = document.getelementbyid("username"); username.setattribute("value", "kimyong95@gmail.com"); } this program navigate "https://console.api.ai/api-client/#/login".
i trying fill "kimyong95@gmail.com" email textbox in website using .setattribute doesn't work.
anyone know how solved this?
thanks!
in provided sample code trying modify element property via element attribute. element attributes cannot used modify element properties: properties , attributes in html
i think sample following link can resolve issue: http://dotnetbrowser-support.teamdev.com/samples/handling-form-fields
Comments
Post a Comment