Just recently put a new site live to be internet facing. The site is built on ASP.NET MVC, and JQuery primarily. We tested the site fairly rigorously in IE6/7/8, Firefox, Safari, Opera, and Chrome. We do capture exceptions and log them.
We've just received a couple complaints where the user is unable to register on the site. There are no exceptions thrown from the .NET layer, just apparently the "register" button doesn't work.
What is the best practices to debug an issue like this? Is there a good way to remotely log client side events? Are we at the point where we need to contact this user and use webex or copilot or similar to see what is happening?
Edit/Update: Big stuff in this realm - you can now remotely utilize webkit developer tools by leveraging Weinre - its awesome. Also for this type of issue, Glimpse is a big help as well.
If you see no errors on the server then the issue is client-side. If the user is unable to relate any more information then that the button is not working then you will most likely be wasting your time trying to troubleshoot this problem over email. I would initiate a remote session with them (using your tool of choice) so you can see their browser and actually be able to debug the issue in person.
What you will probably find is that the browser has javascript disabled or something of that nature.
Probably the quickest thing is to do some sort of remote session with the user's machine. There are all kinds of weird configuration quirks that could be present on their machine that you'd never catch otherwise.
I guess that login button is the first button the user can click.
You probably bind the onclick event using jquery, so the user will have javascript disabled.
Ask user what OS/Browser/Firewall/Anything else that you think might be relevant he is using and try to reproduce the bug on developer's computer.
The best way to debug an user issue is to reproduce it on development computer.
These types of issues have to be reproed, which is a royal pain in the rear. In the next version of Team System, which will not help you here, there is a tool that can record errors for repro, but I do not expect it out until later this year at the earliest.
If this is a client side issue, you will not be able to find any errors with your instrumentation, so there is not much you can do server side. Most likely there is a JavaScript error being thrown and captured by the browser. The user may not even see it, so they may not even know what to tell you to help fix it.
You can instrument JavaScript, to an extent, but it can be overkill.
Related
I've looked through several similar questions on SO but haven't found something quite like what I need, so my question is this:
I want to take a screenshot (thumbnail) of a URL after the user provides one. I was going to use Awesomium because they provide a fairly simple solution for screengrabs. Unfortunately, Awesomium won't compile in an x64 application, and since I'm building this with ASP.NET for Windows Azure, I can't switch to x86.
So I'm left with a less-elegant solution, using Windows.Forms WebBrowser to load the url and take the screenshot (as shown here: http://www.codeproject.com/Articles/95439/Get-ASP-NET-C-2-0-Website-Thumbnail-Screenshot ).
Ugly, I know, but it works with most pages (there is the occasional white screenshot), but now I'm concerned with security.
If the user inputs a malicious URL and the WebBrowser loads it, what is to stop it from running harmful code and downloading a virus to the server where the app is hosted?
There are several services and websites that offer similar functionality, albeit with different approaches, but the core idea is the same: the site must open up the URL and render the page in order to grab the screenshot. So what kind of measures would one expect them to take to thwart viruses and malicious URLs?
The biggest threat to your application would be client script executing in your browser control (i.e. JavaScript and client-side VBScript). It appears it is not possible to disable JavaScript programmatically in the WebBrowser object:
VB.NET WebBrowser disable javascript
Disable javascript in
WinForms WebBrowser control?
Stripping <script> tags in the first question's first answer is not the way to go for security, as there are so many other ways script can get inserted.
Changing window.alert in the second answer won't work as it needs the page to load fully first, and it is possible for script to execute before then. Also, this would only stop the alert function and not prevent script code in any other way.
Changing the registry settings as suggested in this answer may be the way to go, but this appears to be the same as changing Internet Explorer settings to high security for the internet zone (or selecting custom and disabling Active Scripting). If you are always in control of the machine where your app is loaded from, then manually disabling scripting in Internet Explorer options could be a viable solution.
Most client-side internet threats such as drive-by downloads involve script in some way, so this approach will go a long way in protecting your app.
However, there are other exploits such as the Windows Metafile vulnerability that can harm a client machine.
Viewing a website in a web browser that automatically opens WMF files, in which case any potential malicious code may be automatically downloaded and opened. Internet Explorer, the default Web browser for all versions of Microsoft Windows since 1996, does this.
However, making sure your machines are patched with the latest Windows Updates will secure you against threats like these. This will leave zero-day attacks against Internet Explorer or the WebBrowser object, which you will not be able to do much about. I would suggest running your app on an isolated machine (or VM) which would then upload the screenshot to another server (e.g. via the web) which would help mitigate threats in this scenario.
Vague title, but it's tricky to word well in one question.
I have a site which uses a local database to store reviews, and in another table we store ratings of those reviews, so every time someone clicks a thumbs up / thumbs down icon next to a review a new entry is added to that table, much like the "is this review helpful?" feature you see on many sites.
This is done using a js function which triggered when either thumb is clicked on, which then calls an aspx page and in the C# behind we check if the user has already voted on that review, and if so to update the database appropriately (e.g. removing their vote if they have already voted in that direction).
This works well in Chrome and IE on the laptop I am working on. I have tried the latest IE 10 standards as well as IE 8 standards as the latter is what most people will be seeing the site with, but it partly doesn't work on someone else's computer with the same browser version installed and same standards set. I had this user log in to the site on my machine to see if it was a user account issue, but it worked fine for them on my machine.
I have tried loading the site in InPrivate browsing windows to prevent any caching affecting the issue.
It works for them to submit a vote, either up or down, and they can change their vote from up to down, and the database is updated correctly. If they try to remove their vote however, it simply doesn't work.
It's not a user issue, as it works fine for both of us on my machine, and for neither of us on their machine, so I figure it some browser setting of some kind.
Summary:
- Works in Chrome
- Works fully in IE on one computer
- Doesn't work fully in same IE on another computer
Any pointers?
Caching issue. This explains why the database was updated the first time, but each time after it wouldn't work properly. Using the code below to prevent caching:
// Stop Caching in IE
Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache);
// Stop Caching in Firefox
Response.Cache.SetNoStore();
Background:
I am creating a Windows Form App that automates order entry on a intranet Web Application. We have a large amount of order entry that needs to be done that will cost us a lot of money so I volenteered to automate the task.
Problem:
I am using the webbrowser class to navigate the web app. I have gotten very far but reached a road block. There is a part in the app that opens a web dialog page. How do I interact with the web dialog. My instance of the webbrowser class is still with the parent page. I am hoping someone can point me in the right direction.
You've got a number of options. To expand on the answers from others and add a new idea...
Do it using the webbrowser control: This is technically possible by either injecting javascript into the target page as demonstrated here or creating a JavaScript object and using it as a bridge via the webbrowser.objectforscripting property. This is very fragile - something as simple as the website changing an element's Id could break it. You also need to make sure your code doesn't interfere with the functioning of the form (clashing function names, etc...)
Do it using a postback: Monitor the communications between the web browser and the server (I personally prefer Firfox/Firebug but ie/Fiddler or Chrome/F12 are both good too). As long as you can replicate the actions of the browser exactly, the server can't know the difference. The problem here is that browsers are complex and the more secure a form is, the more demanding servers are. This means you may have to fake a login, get cookies, send them back on subsequnt requests, Handle Viewstate data and xss prevention variables. It's possible and it's far more robust than the first option but can be a pain to get working. If it's not a highly secure form,, this is your best bet. More information here
Do it by browser automation: Selenium is probably the best option here (as mentioned by others) but suffers from a similar flaw to the webbrowser control in that it's sensitive to changes on the form itself (But not as mcuh so as the webbrowser control).
Incidentally, if you have Visual Studio Ultimate/Test edition (and some others, not sure which), it includes a suite of testing tools including an excellent engine to automate load testing a website. This is also superb for tracking down what exactly a form does as you can see every step of the emulation.
Hope this helps
You have two choices depending of the level of complexity you need:
Use a HTTP Debugger like Fiddler to find out the POST data you
need to send to each page and mimic it via a HttpWebRequest.
Use a Browser Automation Tool like Selenium and do the job.
NOTE: Your action may be considered as spamming by the website so be ready for IP blocking, CAPTCHA...
You could give Selenium a go: http://seleniumhq.org/
UI automation is a far more intuitive approach to these types of tasks.
I have a program in C# for Windows Phone. It does some really CPU-heavy stuff with IsolatedStorage and cameras and images.
Occasionally, my app crashes. It happens about 1 in 50 times, and each time it does, I end up making some minor modification to the code. I mostly always prevent the app from exiting with try-catch.
But after ~3 months of working on the app, I think it's ready to be released to the public. However, I still want to be notified about crashes so I know how to fix them.
How could I send an email to myself without forcing the user to press Send?
As far as I can tell, users don't really want to report the errors, and as such are likely to press Cancel if they see such a dialog.
EDIT: This crash would only contain the words "Crash at line " and the line number(s) that caused the crash.
EDIT II: Oops, meant a crash every 500-1000 times. Thanks #Andrei.
EDIT III: Using all my data, it seems that this app has only crashed five times out of the 18000+ times I've debugged it. That gives my app a one-in-36000 chance of crashing if the user uses my app for 3 months on an average usage estimate of 20 launches per day, which, in my extremely biased opinion, quite good for an app that makes heavy use of sounds, images, and sensors.
Transmitting info without the user's knowledge is evil. Use reverse psychology:
Fixing crashes by using try-catch is not really fixing them. Treat the cause, not the symptom.
Sending emails without the user's consent in wrong and, since it may contain personal information, might be also illegal. Since it also might cost the user to send data it also makes it commercially less viable as it increases cost for the user without bringing him real benefits.
Sending the crash report to a website instead of an email address looks more professional.
If you don't want the user to have to click to send each crash report you might try to ask the user when he installs the application whether he wants to submit the crash info.
A google search for "silverlight upload file" provided this link. May it help you well.
Can you just upload the crash info with a POST request to a website? It's probably easier to do that and then let the website send an email than it is to send (random) emails in the user's name...
Unless Silverlight for WP7 supports the SmtpClient, there won't be a way to send mail outside of the email app.
There are a few work arounds however:
Create a web service to capture the data, that your wp7 can attempt to make a request to,
Just use the Email function and hope users hit send (you'd be surprised)
Use a service like Flurry that has OnError event logging, and put that in your unhandled exception handler.
Use an email web service proxy to send the email to you.
Well, there is the WPAppManifest.xml in this file you can specify what the user needs to accept.
Here is the EMail thing: http://www.ginktage.com/2011/04/how-to-send-email-in-windows-phone-7-using-c/
I think this would solve your problem.
This is i think the right thing for you: http://www.preemptive.com/products/runtime-intelligence/compare-editions
For WP7 Developer its free.
You can track the application usage from the users. You'll see how many people how long your application are using, and i think also if it crashs...
As others have said, you luckily can't send emails as the user without him knowing - but you can just use a web service.
To improve this, I create the MD5 hash of the stacktrace and first check if the crash happened before and only if it hasn't happened before, I send the crash report.
But I stopped asking the users as well. They just won't do it then. I simply remove all personal data first.
hmmm,
typing the title made me feel like i am a hacker asking for some illegal stuf....
but the truth is different i think. My client wants to control 3 webapplications at different computers at the same time.
I can't say exactly what the porpose of this is, but he wants, when he clicks on computer A at button 1 in the browser, that on computer B in the browser also is clicked on button 1, and also on computer C.
When i devided this process in 3 steps, i realized that none of them are things i've done before:
first thing is to get the click event out of the browser
second is to inform computer number B and C of the click event
third is to click a button in the browser of computer B and C
Three things i don't know how to accomplish (i have done some remoting in the past, maybe that can work for the communication between the three computers, but all i remember is that remoting did NOT become my friend)
So if you can give me any clue on how to catch browser events outside the browser, talk between two pc's and raise events in the browser from outside the browser, your help would be greatly appreciated.
EDIT:
i don't control the application. My client will use it to send multiple stock orders. so i think you can compare it with up-vote on a voting website
I know this is not an answer directly to your question, but it is a valid answer from a business and developer standpoint.
Unless your client is willing to pay through the nose for development time, it would be better to find out WHY the client wants this and offer possible alternatives. What they're asking can't be done without a LOT of work. I'm not sure where I'd even start - probably writing my own browser using the BrowserControl in a WinForms app, and using Remoting to control the WinForms app.
Really, you're better off researching the requirement better and proposing an alternative that is doable. Part of being a good devloper/analyst/project manager, etc is to be able to correctly divine what the customer actually needs from what the customer SAYS they want.
It could be that they just need you to track the status of something and your separate browsers need to auto-refresh. Or it could be that WinForms is not the right tool for the job. Or it could be something completely different. Heck, it could be as simple as only having one browser, and people can "watch" that browser from another PC using VNC or a similar tool.
There are usually multiple ways to meet a business need without focusing on difficult technical requirements. It's the business need that matters. and if you can find another way to meet it, you won't need to spin your wheels on this type of question.
As an added note, it makes me cringe to hear that you're even looking for "how to do this" without understanding why. Getting the requirements right is SO important in development. Most projects fail because the communication of requirements was not adequate.
What you want to do looks like 'shared browsing' or 'follow-me browsing'.
There are some questions that need to be asked :
do you want to do this with or without installing some sort of browser plugin or application ?
is the 'shared browsing' done only on a web application that you develop or do you need to browse to remote websites where you cannot add code.
If the web application can be modified, you could have all clients:
Send all actions they do a server ( #id1, click )
Poll the server for a list of actions that need to be triggered ( jQuery('#id1').click() )
If only one of the client is "master" and all the others are slave, it should be easy enough to synchronise everyone.
In a multi-master setup, synchronisation will be a little more complicated, and then maybe you will be re-developing Google Wave ;-)
Now if you need to be able to do shared browing over any website, thats a lot more complicated. Even more complicated if your solution needs to work cross-browser. You will need to develop extensions for each supported browser or native applications for all supported OSes. I advise you to look for existing solutions that already do have the shared browsing feature. You can also take a look at the VNC family of solutions (full desktop control).
I hope this will help you,
Jerome Wagner