Automating site interaction - testing

I'm working with a CMS and need to import data to it using typical html forms. The data itself is in csv files with one page per row. Such is the CMS that importing directly to db isn't possible due to the complexity of the design. It's pretty important that i "fake" usual user interaction because the CMS does a lot of background work that's crucial for the import.
Basically, for each row in the csv file, I need to copy a csv column to a html textfield, or select a checkbox, or click a certain button. One major issue is mapping the data in the csv to actions in the CMS. So if one column contains the string 'foobar' is really means "set the firstName dropdown widget to 'foobar'".
Is there a tool to automate this? I´ve been looking at AutoHotKey, Selendium, Web-Harvester and many other tools but I'm not convinced they are the correct tools. The main problem is being able to interact with the html pages in a easy way.

There are a bunch of tools that do that. Visual Studio Team Test Edition will do this by recording your actions and allow you to modify the resulting C# programming. You can then read from your CSV and replay in a loop.
You can also do this relatively easily if your interface doesn't change much using HTML Agility Pack.
Also I've written regular C# ( HttpWebRequest and Regex ) programs to do this and it's not very difficult either.

Related

How to Create a Button in a PDF to Select and Copy all Text from a Single Field

I need a person to be able to input information into a field in a PDF then later be able to select and copy all information from that field with a single click so they may paste it into another field on a website.
Purpose. I am trying to create a master application which people with disabilities may complete and use as a simple way to fill out other applications. I don't believe I can create an autofill ability which will be useful for the thousands of different methods of job application but I want the human to be able to select the correct field then, in as few clicks as possible, copy information from a field in the PDF and paste it into one they deem as appropriate in another application.
I am an idiot, this is a passion project.
It may be simpler depending on user cases to work inside the browser framework. Here is totally non typical usage for copy data from local personal html into remote form. IT depends heavily on the remote site accepting it can be embedded as if a local frame thus not useful for generic use but may work for controlled caseload's

Somehow send command line commands on windows externally and get back the response

Problem: Need to convert local html (with local images etc) to pdf from an AIX box running Universe 11.2.5 with System Builder
Current solution: FTP over html file to a Windows server which converts in batches and sends the e-mail to the destination
Proposed Solution: Do everything on the AIX box, from converting html to pdf and sending the e-mail.
Current problem: Unable to find a way to convert local html to PDF on the AIX box. I have been trying many different ways from trying to install Python3, but to no avail.
The only really difficult part of the process is getting the HTML to render into a format will properly display your html into pages that are suitable for printing. There is a fair amount of magic that goes on between HTTP:GET and clicking print on a browser window that needs to be accounted for.
I was trying accomplish something similar many moons ago on AIX but kind of ran into a skill level/time wall because I was going to have essentially create a headless browser to render the html. It looks like there are now some utilities that you might be able to leverage. I found this recent updated article on Super User that actually got me somewhat excited, especially since I don't use AIX anymore so precompiled binaries and well understood and easily attainable dependencies are something I can actually have in my life.
https://superuser.com/questions/280552/how-can-i-render-a-website-as-an-image-from-the-shell
Good Luck.
There seems to be several questions rolled into this one item.
Converting HTML to PDF, while that is just a data manipulation that you could do in basic, writing such code would be a large task. The option you use sending it to another system is valid, but put more points of failure into the system. I would think you could find code to do it on the AIX box.
Rocket plans on getting the MV Python to work on AIX, this will make the converting of html to PDF much easier since there are a lot of open source modules.
As for my suggestion of using sockets, that would be if you intend to send it to a service that will take the htms, and return the pdf document.
i.e. Is there a web service for converting HTML to PDF?
Once you have the pdf document, you can either store it in a UniVerse type-19 file, or do the base64 encoding and store it in UniVerse hash file.
Hope this helps,
Mike

Creating a script that will automate filling out a form on an ad website

I would like to create a script that would help me automate filling out a form on a website. Here is a basic idea that I came up with. The website consists of 5 stages.
Selecting a category and a group of an item
Adding the item. It consists of a title, price, etc...
Selecting the visibility
Finish putting out an ad by clicking I accept.
Deleting the previous ad of the same product
So basically what I had in mind was to sort all of my items in subfolders, each subfolder would contain an image of the item along with an info.txt file. The info.txt file would contain all the information that would be needed for filling out the form (for example title, price, text of the ad, etc...). Using these subfolders and .txt files I'd like to create a script that could help me add my items and fill out a from on an ad-based website.
So my question is: How to do this, what language/script should I use?
I would recommend taking a look at Selenium or PhantomJS. These tools are normally used for running unit tests for web apps in the browser, but I have used them before to do automated stuff on some websites as well. Selenium and PhantomJS are both operated by programming languages.
If you prefer a more simple approach and don't mind using proprietary apps, you could take a look at iMacros, although I am not sure if reading files is easy when using iMacros.

Creating PDF with data source

I've been tasked with creating an editable PDF (or similar off-line accessible) form with certain fields (dropdown lists and the like) prepopulated with data. Based on what is selected in the dropdowns, other text fields will be populated with associated data.
Short of creating a Windows Form with 100+ different fields, is there software that has this capability? I know I can't be the only one with a task like this, but having Googled and searched up and down SO I've drawn a blank.
I felt this was the most appropriate exchange to post this in; apologies if I am mistaken.
EDIT
I have access to Acrobat Pro 7 at work, but it seems unable to do what I described above. Do I need a newer version of Acrobat to achieve what I'm after?
Have you considered using InfoPath? It has basically been designed for this purpose and can interact with external data sources (e.g. SharePoint / databases). You can then convert the InfoPath form to PDF if needed, either using your own code or using third party product such as the PDF Converter for SharePoint
I worked on this product so the usual disclaimers apply.
If you want to do a professional job, you need to use the right tool (Adobe Acrobat Pro):
http://www.adobe.com/products/acrobatpro.html

SSRS 2005: How do I make available varbinary data for download in a report?

SSRS newbie question here...
I have a table where one column is varbinary(max) data. I would like to make a report that makes this data available for download as a hyperlink so the user can just click on the item and get a file download dialog for the binary data. In this particular case, the binary data happens to be the content of old pdf files, but that shouldn't matter.
I tried searching around but I can't find any pointers on how to do this. It seems to me that it should be possible. There are ways to display images in a report using varbinary data, so it makes sense that one should be able to make arbitrary binary data downloadable on a report, right?
No, it is not possible as far as I can tell. Don't see anyway to do this.
The work-around that I used was to create a simple asp.net page to serve the binary content through some URL. I then hyperlinked to that page from the SSRS report giving the right variables in the URL. Works fine for me, YMMV if you have to worry about URL hacking or security issues.