How to create a basic PHP-based web service

I borrowed from this page (http://davidwalsh.name/web-service-php-mysql-xml-json) information on how to create a basic PHP web-service. See the attached/modified version. Simply rename the .txt to .php, then place the attached file in an apache accessible directory and call the page with URL params, like so: http://sv-selenium-t1/service/service.php?id=2&format=xml.

Tags: 

How to write data to a database

Attached are two files used as an example of how to write data to a MySQL database using HTML/PHP.

 

Place these two files inside the document root and call the results.html file. Fill out the form data and hit submit. It will call the insert.php file which will make a database call to the Results database and make the insert to the 'results" table. Simple, and avoids Drupals 30-120 database calls just to load its pages.

Tags: 

How to Encypt & Decrypt using Javascript & Selenium IDE

This article explains how to encrypt & decrypt with JavaScript and the Selenium IDE. You will need the attached user-extension.js installed, which was created from this article: https://code.google.com/p/crypto-js/#AES. Below are the IDE commands that can get you started:

Tags: 

How to Simulate ENTER key

Here is a way to simulate hitting the enter key after you have gained focus of the field:

<tr>
    <td>focus</td>
    <td>//div[@id='block-system-main']/div/div/table/tbody/tr/td[2]/div/div/ul/li[4]/input</td>
    <td></td>
</tr>
<tr>
    <td>sendKeys</td>
    <td>//div[@id='block-system-main']/div/div/table/tbody/tr/td[2]/div/div/ul/li[4]/input</td>
    <td><br /></td>
</tr>

Tags: 

Pages