programmatically interact with webpage - asp.net

http://www.apsalin.com/convert-cartesian-to-geodetic.aspx
I would like to write out a python program that opens the above webpage, fills out 3 text boxes with specific values, hits the "convert" button, and extracts the answer. What is the best way to accomplish this? I've heard of mechanize but that's not available for Python 3.
If there's nothing available to do this in python, what would be a good alternative way of automating website interaction? I'm open to any type of program or programming language.

You could look at mechanize. It should have everything you need to accomplish your goal.

Is Python 3 a pre-requisite? If not, you can check out selenium.
Described as a browser automation tool which is primarily used for automated testing. There are Python bindings availble. I currently use these.

Related

How to make own text editor for math equation?

I'm using C# on Windows (but I can also use C++)
What I want to make is just an own text editor that I can write/edit mathematical equations/formulas.
Reason why I'm looking for this function is that the calculations of my structural analyzing programs are only editable with in my C# code. I want my programs provide a function that a user can add their own formulas for design checking or whatever so that my programs can be more widely used.
I know how to parsing equation of string form to multiple variables in code so I can compute what I want. However, I really have no idea that how to display own text editor. I think it can't be done by textbox and only thing I can think of is using opengl api. But I believe there should be easier and efficient way to this job done.
My programs are currently run on windows only but I'm planning to make OSX version and web version as well. I don't mind if solution only available for windows only or not. If anyone knows easy way to display own text-box, please help me. I will really appreciate for it. Thanks for reading my question.

Unix app to write custom syntax to can check it

well the question is, exist some app or language/etc to write a custom syntax to can check files?
You know, when we works in different places, ppl and projects every one have differents rules to how write, code style and all that things, the idea its can check all this things because at least to me normally i forgot something.
Ideally some app without a heavy GUI, thinking maybe a terminal app, or editors like gedit, avoid plis apps like Eclipse and similars.
For now i need only check simple parts, if you can recommend both a simple/limited app and a complex/full app would be great.
Obvs, if exist a simple/full app, will be better.
Thx.
If what you're looking for is a program that rewrites a source code given a specific coding style, I advise you to take a look at GNU Indent.
If you want to do more complex operations like build an AST and work on it to add things, edit, check for existing dependencies or whatever, you'll want to use a tool like Flex/Bison, Clang, Pyrser, etc.

Possible to search through all JSPs in Adobe CQ5 repository with CRXDE?

We have a couple of relatively simple websites running on Adobe CQ 5.5 that were developed by a third party. I'm pretty familiar with how CQ works, but I'm working with somebody else's code here and I need to be able to search through all components in the system for a particular string.
The issue is that I can't seem to find a way to search across all of the various .jsp files stored with the various system components. I would have figured that the query tool in CRXDE Lite would have done the trick with something like this:
/jcr:root//*[jcr:contains(., 'Find this exact string in a JSP')] order by #jcr:score
But I've had no luck.
What I am looking for is some sort of global search that includes JSP files. Is that possible? Were I using a regular Java system, any IDE worth the download would be able to do this.
Thanks.
Might not be easiest way, but you can use the VLT tool to checkout the repository into your filesystem. Then you can lookup using whatever tool you prefer. It might even be faster in the long run
I don't have the actual answer but I suppose the JSPs are indexed via a filter that strips out some of their content.
It should be possible to configure the repository to index them as is instead, based on the info at http://wiki.apache.org/jackrabbit/IndexingConfiguration and http://jackrabbit.apache.org/jackrabbit-text-extractors.html
Sorry about the vagueness of this answer - I know the basic principles but to provide the details I would need more time than I can afford now ;-)

Flex: Testing UI components at the click level?

I've been working on a Flex component and I'd like to write some automated tests for it. The trouble is, the UI testing tools I've looked at (FlexMonkey and Selenium Flex API) don't simulate "enough":
Most of the bugs which have come up so far relate to the way Flex deals with dragging and dropping, which these libraries can't simulate accurately enough. For example, I need to test a case where there is a "drop" event which occurs in the bottom half of a component – neither FlexMonkey nor Selenium Flex API can do that (they may simulate a mouse event, but they won't include coordinates).
So, is there any "good" way to automate that sort of testing?
Edit: After much research, it looks like the only piece of software that can do this is iMacros, which is Windows-only and the interface is... Lacking. So I'm going to be writing my own. Basically, it will put an HTTP interface on java.awt.Robot so code (in any language) can simulate mouse/keyboard events. If you're interested, PM me and I'll keep you updated.
Edit 2: I have published the first version of the framework I wrote, Blunderbuss, over at BitBucket: http://bitbucket.org/wolever/blunderbuss/ . You'll need Jython to run it (http://www.jython.org/), but after that the flex-client example should work.
Videos of Blunderbuss live over at Vimeo:
Automating Flex testing with Blunderbuss
Blunderbuss test suite running
At the moment this remains a proof-of-concept, as I haven't had the cycles to clean it up and make it more useable… But maybe enough people bothering me would give me that time :)
I've used Eggplant to test Flash and AIR apps without having to add any hooks into the code. It's a great tool but it's quite expensive. It simulates a real user by VNC-ing into a system and uses image recognition - among other things - to interact with the app.
I am definitely interested in your custom Java class, and (though I am not the best at Java (yet...)), I would be willing to help out if you're thinking of making this collaborative.
As to Flash MouseEvents. Unfortunately, there really isn't an accurate way to simulate the drag/drop experience in Flash. MouseEvents, when generated by the mouse, are handled in a very different way than regular events and while you could simulate actions by passing events into the handling functions, or by making the dispatcher fire a new DragEvent( DragEvent.DRAG_DROP..., it will not be the same as having the user interact with it. And for some functionality (like gaining access to the clipboard), nothing inside Flash will accomplish your goals.
To be honest, you're probably headed in the right direction -- using something which is not written in Flash to drive faked mouse events is probably your best bet.
I've never had to use it in Flex but i recently stumbled across some info on automation packages in the MS Surface SDK... after looking into it those classes automated user behavior which can be used for testing i.e. move a fake mouse to this point, perform this action. As you're using Flex mx.automation packages and classes. My guess (and hope) is that you'd be able to achieve what you want using these classes.
You could also try auto-hotkey - it is similarly a macro-editing program but it has proven to be very efficient and you can write scripts and set it up very easily.

What interesting things can be done with dcop?

I have been using UNIX for years and the dcop command only recently came to my attention. What is its primary purpose and is using it in any process a sign of poor design?
is using it in any process a sign of poor design?
Probably not, as long as you're using DCOP to perform some task that would ordinarily be done with a mouse click or hotkey. It's certainly way better design than trying to control the mouse to do what you want to do with the program!
But if you use DCOP to do something really simple that could be done directly with a shell command or a few lines of C code, without invoking a KDE application at all, it's probably better to just do it the direct way. (e.g. don't use DCOP to tell Konqueror to remove a directory tree, just run rm -rf)
I suspect it mainly exists because everything in UNIX ought to be accessible from the command line.
The Wikipedia article on dcop is worth a read.
It's great for any scripts to use to control processes, there's also good information on controlling Amarok via dcop.

Resources