MySQL - Creating Data Tables To Use In Selenium WebDriver Test

Before creating tables In MySQL database, It must live on Installed In your system. You tin read my previous shipping service to know how to download together with Install MySQL In windows system. We are going to perform MySQL database testing using selenium WebDriver. So We bespeak to exercise tabular array Inside
database together with bespeak to Insert roughly information In It manually. Execute bellow given steps.


Step 1 : Connect MySQL Server from ascendency line
  • Open MySQL ascendency trouble customer from Start menu.
  • It volition inquire you lot to operate inwards password. Enter your login password which was develop during MySQL config step.

  • It volition impress message equally bellow In ascendency prompt. Now you lot are connected alongside database.

Step 2 : View available databases In MySQL
To persuasion available databases In mysql, you lot bespeak to execute bellow given ascendency In ascendency prompt.
  • Execute show databases; ascendency In MySQL ascendency trouble customer equally bellow. It volition demo you lot listing of all available databases.
  • As you lot tin run across In inwards a higher house Image, at that topographic point Is i default database alongside refer "test". We tin purpose It to exercise our table.
Step 3 : Select database to exercise table.
Execute bellow given ascendency In MySQL ascendency trouble to conduct "test" database for creating tabular array In It.
  • Execute use test ascendency to conduct "test" database from list.
  • It volition demo you lot message Database changed equally shown In inwards a higher house Image.
Step 4 : Create tabular array In "test" database.
Now nosotros are going to exercise novel tabular array Inside "test" database. Let's banking concern gibe If at that topographic point Is whatever tabular array available In "test" database earlier creating tabular array In It.
  • Execute show tables; ascendency In ascendency line. It volition demo you lot bellow given result.
  • There Is non available whatever tabular array Inside "test" database. Let's exercise novel tabular array "user" In exam database alongside iv columns id, name, urban heart together with someone together with age.
  • To create "user" table, execute interrogation CREATE TABLE user (id INT(6), refer VARCHAR(20), urban heart together with someone VARCHAR(20), historic menses INT(6)); In ascendency trouble equally bellow.

  • It volition exercise "user" tabular array Inside "test" database alongside iv columns.
Step 5 : Insert information In "user" table
Now nosotros tin Insert information In user table. Execute bellow given queries i past times i In MySQL ascendency trouble client. It volition Insert tape i past times i In "user" table.

  • INSERT INTO user (id, name, city, age) VALUES (1, 'smith', 'London', 25);
  • INSERT INTO user (id, name, city, age) VALUES (2, 'Daniel', 'Boston', 37);
  • INSERT INTO user (id, name, city, age) VALUES (3, 'Anup', 'Delhi', 22);
  • INSERT INTO user (id, name, city, age) VALUES (4, 'Joshua', 'Boston', 33);
  • INSERT INTO user (id, name, city, age) VALUES (5, 'Karan', 'Delhi', 45);
  • INSERT INTO user (id, name, city, age) VALUES (6, 'Karishma', 'Delhi', 21);



Step 6 : persuasion tabular array data
Now nosotros tin persuasion "user" tabular array data. 
  • Execute interrogation "select * from user;" to persuasion information from user table.

Now nosotros convey information tabular array In MySQL database which nosotros tin purpose In selenium WebDriver test. Next footstep volition say you lot how to fetch information from tabular array using conduct interrogation In exam script.

More interesting articles here :Generation Enggelmundus Internet Marketing Tool here :Zeageat IM http://www.software-testing-tutorials-automation.com/
Post a Comment (0)
Previous Post Next Post