Launch QTP from a webpage
I am looking to create some sort of webpage where someone on our network who does not have QTP could launch some QTP scripts from a dedicated QTP machine. I am also looking to configure this webpage to have some radio buttons that will allow the user to pick from a number of test depth levels that I have written into my scripts.
I remember seeing a post where someone did this but I can't find it. Does anyone know how to do this? Any sample code would be much appreciated.
1. WAMP - PHP my sql and apache will be your friend . Easy to build site as per your requirement.Sample code is here for php page ( not as per your requirement).
Technology Tree: PHP - Insert Data From a Form Into a Database
2. ASP.Net -easiest thing to build a site and can invoke remote QTP machine by n-number of way. If you have Visual studio for web , you are done with minimal effort.
3. You can also create C# (or VB) small software that can be install on multiple machine ( and no need to run webserver than like in example 1 and example 2) That I prefer to do for creating test utilities (currently as in subject).
Sorry I have no model code for your exact requirement.
I did something similar a long time ago, but not to connect to a remote machine, just the machine the web page was launched from. I only did it to prove it would work so it was pretty basic and I didn't develop it to see what the limitations were.
I embedded a VBS AOM function within the page and had radio buttons for 'run one iteration' and 'run all iterations' & a button for run.
I posted the HTML on here, you might find it searching for my user ID and a term like 'launch QTP from webpage'
I don't know if your devs happen to be using Jenkins for builds, but even if not it's a free open source tool that can be used to do this among many other things. While also tracking history and such. Can setup a build that is fed a slew of different parameters that can then feed a vbs call on the remote machine to startup qtp.
I have created websites to do exactly this. I used Visual Studio express version (Visual Web Developer Express : The Official Microsoft ASP.NET Site). Depending on the functionality you want the site to have, it's pretty simple...but a few caveats. I'll share a couple things that I came across:
1) When I was first setting the website up, it kept failing when I would launch the page. It said that the DLL for ALM had to be registered. I would run the register tool in windows (regsvr32.exe) but it didn't change anything. After hours of frustration, I happened to navigate to our QC/ALM website and it went through with the install that it does. After that, everything worked. So make sure you go to your QC/ALM website on the machine you are developing and deploying on.
2) I gave users the ability to edit a datatable on the website. Using the COM DLL for Excel causes a ton of problems and only one instance can be created. I ended up using a 3rd party DLL to get the data from the spreadsheet. You could also access the spreadsheet via a database connection, but I didn't care for that route.
3) I don't remember if I actually tested the ability for the server to call a test or not, but I didn't go that route. I think it boiled down to the user not being able to track the progress or stop the test they submitted. I wound up writing a windows form application that would handle the test execution. It would then download to the users computer and the parameters would be submitted to the exe. When you try to use WindowsSystemObject (or any DLL) to create a folder, the browser gives you an ActiveX warning every time. This will happen every time the user visits the site. That also makes the website exclusive to IE at that point as well. Looking back, there may a be way resolve it in some way and be handle exclusively by the server. I think it was a persistence but there are ways around that I believe.
If you have any questions, feel free to message