This question is locked. New answers and comments are not allowed.
Hello. I've faced with the situation when onChange event doesn't invoke. I have next element:
<input id="txtName" type="text" style="width: 300px;" onchange="txtNameChanged();" id="txtName" maxlength="50" value="Test" name="txtName">
I put the value into this input element using TxtName.Text = "TestValue". Everything is OK. But after the value was inputted the method onchange="txtNameChanged(); should be invoked. It doesn't happens automatically.
I tried to use InvokeEvent(ScriptEventType.OnChange); after TxtName.Text = "TestValue"; but nothing happens. Method onChange still wasn't invoked. Also I tried ActiveBrowser.Actions.InvokeScript("txtNameChanged();"); but it generates me exceptions
Test method Creation threw exception: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [txtNameChanged();] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Object expected
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request,
Could you please help me with onChange event. How can I type the text into the input and invoke method txtNameChanged(); ????
<input id="txtName" type="text" style="width: 300px;" onchange="txtNameChanged();" id="txtName" maxlength="50" value="Test" name="txtName">
I put the value into this input element using TxtName.Text = "TestValue". Everything is OK. But after the value was inputted the method onchange="txtNameChanged(); should be invoked. It doesn't happens automatically.
I tried to use InvokeEvent(ScriptEventType.OnChange); after TxtName.Text = "TestValue"; but nothing happens. Method onChange still wasn't invoked. Also I tried ActiveBrowser.Actions.InvokeScript("txtNameChanged();"); but it generates me exceptions
Test method Creation threw exception: ArtOfTest.WebAii.Exceptions.ExecuteCommandException: ExecuteCommand failed!
InError set by the client. Client Error:
System.InvalidOperationException: Javascript call [txtNameChanged();] failed! Please make the function exists and the call is using the correct prototype signature. Javascript error: TypeError: Object expected
at ArtOfTest.InternetExplorer.IECommandProcessor.InvokeFunction(String functionCall, Boolean useEval, Boolean returnJSON)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessActionCommands(BrowserCommand request)
at ArtOfTest.InternetExplorer.IECommandProcessor.ProcessCommand(WebBrowserClass ieInstance, BrowserCommand request,
Could you please help me with onChange event. How can I type the text into the input and invoke method txtNameChanged(); ????