Testing a method that implements IHttpHandler.ProcessRequest - debugging

So I have a method that implements IHttpHandler.ProcessRequest. It accepts an HttpContext parameter. This parameter is just a form that is filled out with some XML. Here is the HTML that I am using to generate the post context:
<html>
<body>
<form name="form1" method="post" action="http://localhost:7703/api.ashx">
<textarea name="XML" id="XML" rows="25" cols="100"></textarea>
<br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>
As you can see, very simple. This is just used for testing purposes. What I am doing is posting XML in that textbox, and hitting submit. However, I am not sure what to attach my visual studio project to in order to debug. I try attaching it to w3wp.exe like I do when I test the app in a browser and stuff, but that doesn't seem to be working. It still says "This breakpoint will never be hit, no symbols loaded..." blah blah blah, when I put a breakpoint next to the ProcessRequest method and attach.
How do I test this properly?
Thanks guys.

If you run this locally you should be able to "run" it from within Visual Studio and VS will automatically attach it self to the correct process.

If I attach to the development server at the same port as the post, it works! :)

Related

Unable to click OK button in pop-up in webdriver using ruby

Unable to click on OK button
I tried like this but it is not clicking.
b.find_element(name: "OK").click #----> it is not clicking
How to interact with this type of pop-us in ruby.
<input class="copybutton" type="button" title="Copy" onclick="copyErrText()" name="copy" value=""/>
<!-- *** Added: copy button *** -->
<button class="button" onclick="disp()" name="OK" value="OK" type="button">OK</button>
You can try one of the following it may help you.
ele = find_element(name: "OK")
driver.action.move_to(ele).click(ele).perform
or
driver.execute_script("arguments[0].click();",ele)
or
driver.execute_script("disp();")
You've tagged this Watir, but your syntax is Selenium. If you are using Watir, it would look like this:
browser.button(name: 'OK').click
If there are funky javascript things going on, you can fire an event to interact with it. Use this power sparingly.
browser.button(name: 'OK').fire_event :click
Hope this helps.
driver.switch_to.alert.accept

Trouble with jquery.steps

I'm working with jquery.steps plugin, but when I open the page in browser, I get the message 'TypeError: $(...).steps is not a function'. Here is my example code (I'm using Laravel):
{!! HTML::script(asset("/js/wizard.js")) !!} {{-- wizard.js contains jquery.min.js and jquery.steps.min.js, generated via gulp --}}
<div id="wizard">
<h1>First Step</h1>
<div>First Content</div>
<h1>Second Step</h1>
<div>Second Content</div>
</div>
<script>
var wizard = $("#wizard").steps();
wizard.steps("add", {
title: "HTML code",
content: "<strong>HTML code</strong>"
});
</script>
Am I missing something basic, or this is not working as expected. Any suggestion is appreciated.
Thanks in advance
Make sure you do not import jquery twice. If you downloaded your jquery.steps library via a package manager, it might have downloaded jquery library as a dependency of jquery.steps so that causes a conflict with your already imported jquery file. You can also try to use a standalone version of jquery.steps.

Object doesn't support this property or method: 'Document.getElementById' in IE10

I'm having to debug some vbscript in IE10. The script launches the microsoft Remote Desktop ActiveX control and has worked absolutely fine up to and including IE9. In IE10 (non-compatibility mode) it throws an error "Object doesn't support this property or method: 'Document.getElementById'"
The relevant section of code is
sub OnControlLoad
set Control = Document.getElementById("MsRdpClient")
if Not Control is Nothing then
if Control.readyState = 4 then
Document.all.connectButton.disabled = FALSE
end if
end if
end sub
and the object with id MsRdpClient is
<OBJECT language="vbscript" ID="MsRdpClient"
onreadystatechange="OnControlLoad"
CLASSID="CLSID:9059f30f-4eb1-4bd2-9fdc-36f43a218f4a"
CODEBASE="msrdp.cab#version=5,1,2600,1095"
WIDTH=800
HEIGHT=600>
</OBJECT>
I have tested with some very simple scripts such as
<script language="VbScript">
Function btnCheck_OnClick()
MsgBox ("test")
MsgBox (Document.getElementById("txtName").Value)
End Function
</script>
<form name="form1" method="post" action="">
<input type="text" name="txtName" id="txtName" value="TEST">
<input type="button" name="btnCheck" value="GetValue">
</form>
and this throws the same error in IE10 non-compatibility mode (Object doesn't support this property or method: 'Document.getElementById'), but works fine in IE10 compatibility mode and IE9. Does anyone have any idea why the document object in vbscript does not have the getElementByID method available, and more importantly, how to get round it?
It's document, not Document. I suspect the behaviour of older versions of IE worked incorrectly.
MDN

FineUploader 3.6.0 object File is not a File or INPUT element Ignoring

I am trying to integrate fine uploader into my hybrid mobile app (using Icenium). I have all the files needed and the uploader runs perfectly when I'm running the app in the simulator. When I run my app on my iphone I get the [FineUploader 3.6.0] [object File] is not a File or INPUT element! Ignoring!. I can't for the life of me figure out why I would be getting this.
This is my config...
$(document).ready(function() {
$('#fineUploader').fineUploader({
request: {
endpoint: 'uploadurl'
}
});
});
I have navigated to the demo page for the jquery wrapper which uses the previous config and the demo runs fine. Any ideas? I'm not sure how to debug this any further.
Thanks
EDIT:
View -
<div data-role="view" id="queue-view" data-title="Queue" data-show="app.queueView.show" data-transition="slide:left" style="display: none;">
<header data-role="header">
<div data-role="navbar">
<a data-align="left" data-icon="menuicon" data-role="button" data-click="app.applicationLayout.onMenuClick"></a>
<span data-role="view-title"></span>
</div>
</header>
<button id="filesButton">Add Files</button>
<div id="fineUploader" class="upload-cont">
</div>
<div id="fineUploader2" class="upload-cont">
</div>
<input id="cameraButton" type="file" name="camera" accept="image/*;capture=camera">
</div>
ViewModel (app.queueView.show) -
$('#fineUploader').fineUploader({
request: {
endpoint: 'uploadurl'
}
});
I have also tried the direct from camera code which simply gives me undefined errors. That's why there is an extra fineUPloader2 and the cameraButton. I have tried a lot of things and all seem to result in either undefined errors or the No files error.
I'm also using require.js to bring in my javascript files (which I have many since I have set my project up using MVVM).
Thanks
Your issue was caused by a bug in Fine Uploader that appeared only when File objects are created in a frame/window/context other than the frame/window/context where the uploader instance was created. There are a couple issues filed here. Yours, (#870) and another, similar issue (#866). The issue was caused by the use of instanceof to determine if an object was a File. Both cited issues have been fixed in the associated hotfix branch in the Github project. I plan on pushing out a 3.6.1 hotfix release with these fixes in the next 24 hours or so.

How do you suppress script errors in HTAs?

I have an HTA that loads up an external webpage inside a nested IFRAME. This webpage (which I don't have control over) throws an "Access Denied" error in my HTA asking the user if they "want to continue running scripts on this page". What I want to do is have my HTA suppress all scripting error messages regardless of where they originate
Here's a very basic idea of how my setup is working:
<html>
<head><HTA:APPLICATION ... ... </head>
<body>
...
<div id="navigation">...</div>
<div id="browsers">
<iframe APPLICATION="yes" src="http://myserver/browse.php?src=http://www.example.com/">
<!-- contents of http://myserver/browse.php?src=http://www.example.com/ -->
<html>...
<body>
<div id="titlebar">...</div>
<iframe APPLICATION="no" src="http://www.example.com/">
<!-- contents of http://www.example.com/ with js that causes error -->
</iframe>
</body>
</html>
</iframe>
<iframe APPICATION="yes" src="http://myserver/browse.php?src=somethingelese"></iframe>
</div>
</body>
</html>
And here is a screenshot of the error:
As far as I know there isn't a way to suppress errors like that. If you have access to their registry or group policy here is the relevant Registry Value (for IE naturally) that disables that popup:
Key: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main
Name: Disable Script Debugger
Type: REG_SZ
Value: no
A sentinent GetWindowText() -> SendMessage WM_CLOSE based dialog closer could deal with that but is not exactly disabling
I've been searching for days and haven't found solid solution - perhaps HTAs do not serve their simplistic rationale after all, at least when using actual browser info
By the way changing the IE8 script debugger does not disable the error message - it merely disables the debug dialog and replaces it with a script error
Unchecking the IE flag "Error Dlg Displayed On Every Error" does not alleviate the issue either

Resources