Selenium Server from website - php

Does anyone know of a simple way to send commands to a selenium server over a web interface? I am trying to automate the filling of several online forms (each requiring a login) but I don't want to do it from the local machine but rather a website so my employees can use it as well. This would save us time being that we currently fill out 8-10 different forms all with the same basic data. I have looked into form filling software but I really want this done by one server in the background. I don't think CURL would able to deal with the amount of DOM elements each website uses and some use those fancy ajax elements. I am pretty good at writing PHP, my original thinking was I could setup the selenium server with PHPunit and execute the scripts from any remote machine. I was sad to find this is still a command line only approach.
I appreciate any advice or technical info provided! Of course, if anyone knows of a better solution than selenium for automating web form filling by a server I would appreciate that info as well.

For this you can create your own Web interface and submit the data in some remote database.
Then whenever you execute testcases it should take testdata from the database.

You can use HUDSON and integrate the selenium project in there. Hudson is a CI tool which has a UI and logins as per your requirement you can also create an individual login for your employees and just they have to login and click on a play button to fill the forms.

Related

PHP with socket.io or recreate everything in node.js and socket.io?

I'm currently planning on coding a private project, to be more specific a virtual chat room, where avatars can walk around chat.
Now I'm literally a little confused, which language should be used to code it in. For now I've used PHP for the backend things, such as authentification and HTML for the frontend.
But i know i will need to use Javascript, to draw the chatroom assets to a canvas element. And i will need to use socket.io (node.js) for the chat and the packets.
Now my question, can I even use PHP in the backend and use socket.io for the communication between the server and the client and the chat itself?
For now the process is the following:
User logs into a account, the background check is done in php
User gets redirected to a Dashboard
User selects the menu point world
User selects a chat world and gets redirected to another site which contains a canvas and a chatbox
Screenshot of step 3: Select world
Screenshot of step 4: Canvas with chatbox
How could I create a socket after building the canvas to use socket io to communicate with the server and to create the chat application?
Would it be easier to code the whole site without PHP and just using node.js and socket.io (Also for the user autentification etc) ?
I appreciate any kind of suggestions and help
hmmm I assume you have good PHP skills but rather new to nodejs/socketio.
Yes nodejs can be better in real-time but it's rather for achieving scalability and it has its ecosystem, if you don't need either you can do it in PHP too.However, you can have both php and nodejs and that's perfeclty sane.
It will probably go like this : php for http requests and nodejs/socket.io for websockets connections, this setup will work if you don't need to call php from nodejs nor vice-versa(but both can still access the same database).
Now if you need to call either from either there are ways including message queues(like RabbitMQ) or exposing an HTTP API from one or either of them.
As for coding the whole thing in nodejs I wouldn't do that, php is pretty good at the tasks you mentioned, I still think that using nodejs for chats is going to be better .
Now you mentioned that it's private, in the future team members matter.
If this project is for learning purposes I do think that nodejs skills would be good to have under belt whether you need its scalability and/or ecosystem or not.

Create web app and mobile app with same MySQL DB on web server

Hi all,
i want create mobile app (i use phonegap) that retrieve and insert data in MySQL Database on web server also i will create website that connected to the same Database using (PHP).
I need guidance:
What topics should i know/use ?
What things should be implemented in Web development process ?
Can i use shared host or i will have to rent dedicated server ?
Is phonegap the right choice to accomplish the project ?
.........
Any guidance will be great.
Thank you All.
Your lack of familiarity with the technologies involved leads me to believe you are making a mole hill out of a mountain. All the skills involved need time/effort and no one answer here will cover your question.
There are various methods to achieve what you ask... I suggest starting with learning how to write some HTML5, then move on to doing a bit of Javascript and then follow it with a bit on jQuery. These skills are what you will use to place text on your web page or app.
After that, learn how to install MySQL, Apache, MySQL and PHP on your laptop. These skills will help you save data on to a server.
Then you need to learn how to combine them so that the data sent from your web app gets checked prior to saving on the server.
Then follow with how to read the data from the server and prepare it for re-display back on your web page or web app.
Once that is done - learn how to use the PhoneGap build service so you can package your app and try it on your device.
I suspect if you start now, and do 10-20 hours a week, you might get something buggy working by Christmas.
Best of luck!

server sent events - One client to update them all

Alright, so here is what I am trying to achieve. I have a custom built Point of Sale done in VB.net. What I want to add now is a customer facing android tablet that shows the reciept as it's entered into the Point of Sale.
Brainstorming how to do this I came up with the idea to use a php hosted script (no problem as the POS has a mysql-php web backend on a local server) that would use server sent events to update the tablet. The issue I'm facing is I'm not sure how to update the server (and thus the tablet) from another client (this one being the Point of Sale).
I can't seem to find any examples other than clocks for server sent events, does anyone have a link to something similar or perhaps a better solution than what I came up with?
I had considered using an app like idisplay and just extending that way, but it doesn't support windows 8 which is what the POS is running. I also considered websockets, but I don't have a firm enough grasp of that to get it up and running. I could make an app for the tablet, but I don't really want to do that, most of my background with app development is on iOS and I don't personally like java as a development language.
EDIT 1: Alright, so I'm understanding better how I would need to make this work.
So far I have it working where I can input a $_GET variable to change the value and the next time an update is pushed it works properly. I just need to verify there's new or different data before it pushes the data.
Is there a better example than this http://www.html5rocks.com/en/tutorials/eventsource/basics/ concerning how to push updates on demand to the listening clients?

PHP AMQ library encrypted credentials over WAN

I'm working on a project where we have jobs submitted via a web interface (backend is PHP), and those are to appear in a queue (rabbitmq backend) on a server across the WAN. I have the PHP producer working fine, without any kind of authentication or encryption.
I'm currently working on implementing some kind of authentication (we don't want anyone submitting jobs to our server all willy nilly).
However, I can't find a way in any of the PHP libraries to use SSL [I partially have it working on the server, but can't get the client]. I want to avoid someone being able to traffic sniff and get our credentials, and possibly submit jobs.
The jobs being passed are just IDs that relate to a database, so they're not sensitive, just the credentials are.
Is there something I'm missing? Is there an undocumented feature in any of these libraries? Is there one I may have not tried? The one I tried, and currently am using, is the one via PECL (php-amqp I believe).
After even more continuous research, I found another (newer) library, that may be of help.
https://github.com/BraveSirRobin/amqphp
I would still love other input, from others more experienced with AMQ and PHP

Pass data between webpage and VB application

I am developing an application for internal use in our company. The purpose of this application is for document imaging. What we are wanting to do is print a barcode label to attach to documents so that when they are scanned in a piece of software such as vfiler will be able to read the barcodes and know how to file them.
The main focus is our ERP system which is web based (PHP). We are wanting to modify the code to allow the user to print the barcode label immediately once they enter an order or PO. I have access to the source code for the ERP web pages. I don't know of any way to make a web page print to a printer without displaying the printer select dialog. So, I decided that I wanted to try and create a VB application that would do the printing of the barcodes. This would allow me to bypass the the printer select dialog.
Now for the question. Is there any way to have a web page (PHP) running on the server call a VB app to perform a task? So, if I had a button on the webpage and the user clicked it, that button would somehow send the pertinent information (Order number) to the VB app and the VB app would print the barcode. The VB app will always be running on the machine. The label printers will be Zebra USB label printers on each person's machine.
Any thoughts appreciated.
Thanks,
Keith
The way I implemented something like this was to have an Windows service, running on a different system from the webserver, watching the upload folders on the web server, then moving the files to the appropriate location for further processing. I tracked the movement of files through the system by creating an initial record upon a success upload, then creating a transaction record for each activity afterward (printed, faxed, emailed, sent for manual review, etc). This insured a reportaable audit trail for each document and helped identify 'orphan' files that would happen sometimes.
The important thing with a service like this is making sure that you've configured security properly so that the service has access to resources like printers and network drives.
You could make the VB app a service, then implement a FileSystemWatcher on a specific folder. When the user clicks the Print button, all the webpage does is save a file with the necessary info to the folder that is being watched.
It seems an old question but maybe this answer would help someone else. It would be much easier to implement this with a command line app. Just pass the necessary parameters into the exe file with PHP exec().
exec("barcodePrint.exe -barcodeValue");

Categories