Chapter 2: How to use Selenium RC

How to use Selenium RC

You Create a New Project to work.
1.Go to File -> New -> Java Project, and enter BeginSelenium into project name field( You can enter another name)
2.Click on and buttons to complete creating project
3.You create a New Class by:

4.The eclipse “New Java Class” wizard appears. You enter “TestLogin” into Name field. NOTE: Java type names usually start with an uppercase letter “TestLogin”
5.Type “com.example.tests” into package. This package used for classes contact together.
6.Click on button. Like this:

7.You create a code in IDE that I have told above chapter that name is “about how to run Selenium IDE. I’ll write a very simple test case to execute by Selenium.”
After that you convert to Java(UNIT) Selenium by:


After convert and copy all of code lines


And you past to Editor of Eclipse. Like this:



8.There are a lot of errors occurs,but don’t worry about it.
9.Next, you copy the TestLogin and overwrite Untitled
10.Removed code from the third line to the seventh line.
11.Change link in SetUp to http://yahoo.com.vn Result:
12.Change “/config/login_verify2?&.src=ym” to “/”. Like this:



13.Error code still display, because they need a Selenium Library and External JARs files of selenium, so you focus to name of project.


14.Press Alt+ ENTER key to open the properties of project


15.You select Java Build Path, see above image.
16.You click on button, a JAVA select dialog appear and find to file .jar file with name selenium-java-client-driver.jar in directory “.... \selenium-remote-control-1.0.3\selenium-java-client-driver-1.0.1”.



17.Click on Open button and click on OK on dialog to close Properties dialog. You will see there is a little error. Like this:


18.To solve the final error, you click on Error icon and select “Configure build path...”.



19.The properties of project appears again, click on “Add Library” button,
20.Select JUnit and click on button



21.Select JUnit 4 in dropdown and click on button



22.Click on button to close the Properties of project.
23.No error appears.



24.There is a Warning, this warning say “import java.util.regex.Pattern;” is never usued. So you can delete this line.
25.OK. We finish test case about Login on yahoo com, now, we run it
26.In order run it, you have to run selenium Server that I told the previous chapter.
27.Right click on name of project --> Run as --> JUnit Test

continue: How to create Test Suite for selenium IDE.

Have a nice day my friends!!!!!!!!!!!!!^^

Đọc Tiếp...

Example about how to run Selenium IDE.

I’ll write a very simple test case to execute by Selenium.
Title of test case: Verify that login successful when using valid account .
Step 1: For Firefox, go to link: https://login.yahoo.com/config/login_verify2?&.src=ym
Step 2: Input valid user name into Yahoo!ID field
Step 3: Input valid password into password field
Step 4: click on button
Expected the result: Login should successful.

The following is step by step to use Selenium IDE.
1.Open Selenium IDE by click on Tools of browser and select Selenium IDE
2.Click on button if it is off.

3.Open link: https://login.yahoo.com/config/login_verify2?&.src=ym
4.Input valid username into Yahoo!ID field (this username is already existed) such as test_selenium0310
5.Input valid password into password field such as 123456
6.Click on button
7.In order test the result, we have to verify that a unique name which exists on logged in page. I select “Hello- Test-selenium03 “to verify that Login successful.
You right click on Hello- Test-selenium03 word and select “verifyTextPresent Hello Test-selenium03”.

8.Now, you click on button to turn off recording.
9.After completing recording the result is like the below the screen.


Could you run it successful?
NO, you cannot.If you execute it, error occurs to say Hello Selenium is not present. Because the test tool runs faster than the page loads, so we have to wait until the page is loaded completely.
Error Like this:


You can solve this problem easily.
Steps:
1. Click on the fourth row. Like this:

2.You click on dropdown of comment and select clickAndWait
3.At the Value field, you enter 30000
OK. We have just finished writing test case using Selenium.

==>You can run by click on play button.

Wait: do you see code in Source code?. Yes, of course. You can create a “.html” file to create test case for Selenium IDE for you.

Have a nice day!!

Đọc Tiếp...

How to install Selenium Install?

You follow the steps to install Selenium.
1.Using Firefox, first, download the IDE from the SeleniumHQ from here
2.Click on link of Selenium IDE
3.A Popup display, then you click on button

4.When downloading from Firefox, you’ll be presented with the following window and click on button

5.The Firefox Add-ons window pops up, first showing a progress bar, and when the download is complete, displays the following and click on button to complete the install Selenium.

6.After restart the Firefox, you go to Tools, you will see Selenium IDE is installed.


Have a nice day! ^^

Đọc Tiếp...

Introduction alittle about Selenium

Selenium is a testing tool for web applications that uses JavaScript and Iframes to run tests directly in a browser such are IE, Firefox... There are several test tools based on this technology: Selenium Core, Selenium IDE, Selenium Remote Control (RC)…..
Selenium Core (Core) is a DHTML test execution framework.
It is the engine of both, Selenium IDE and Selenium RC (driven mode), but it also can be deployed on the desired application server.
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing you to easily and quickly record and play back tests in the actual environment that they will run.
Selenium Remote Control is the server version of Selenium. You write your tests using client APIs and these communicate with the server. The server then 'runs' your actions for you in the browser and reports the results back to your client.
Using Selenium-RC allows you to write Automated tests in any supported programming language.

Đọc Tiếp...

Download TeamViewer free!!!! Free!

A free software for remote computer, it is very important for everyone who uses computer.^^. download at Download softare .



Cách Sử dụng:
After download into your computer, you install teamviewer in your computer, Example you use A computer controls B computer
1. Both machines open Teamviewer.
2. Send ID and Password of B machine to A machine.
3. Enter ID into ID filed on the left side of A computer and click connect Partner button
4. A new dialog appears, You continue to enter password that sent by B computer
Mission!.

Good luck to you!

Đọc Tiếp...

listen english- Topic: Auto Mechanic

Randall Davis - Auto Mechanic.mp3


>> My car was acting up recently and wasn't running right, so I took it to a mechanic to have it checked. Everytime I tried to start the car, the engine would turn over for a second or two and then die. The mechanic pulled the car into his garage to look things over. The mechanic popped the hood, checked to see if all the hoses and belts were in working order, and then tested the car battery and battery cables. After taking a look at things for a few minutes and trying to get the car going, the mechanic diagnosed the problem as a bad alternator. He said he could fix the problem by replacing the alternator with a new ($130) or a rebuilt alternator ($80). Just diagnosing the problem cost $65, and the labor was $50. I asked the mechanic to go ahead and do the repairs, and he said that there was a 30-day warranty on parts and labor. Some mechanics might overcharge you for repairs, but the mechanic I go to is fair and does great work.
Đọc Tiếp...

Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to...

I'm using XAMPP.
If you have problem with this error:
Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Krasnoyarsk' for '7.0/no DST' instead in C:\xampp\htdocs\guestbook\index.php on line 12.

you just put at the top of the index.php page.

After upgrading webservers php 5.2.9 to new stable 5.3.0 wordpress started to give following errors to every page, this error message appears:
Warning: strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Helsinki' for 'EEST/3.0/DST' instead in /path/to/my/www/wp-includes/functions.php on line 35

In /wp/wp-includes/functions.php
Add the following before the first function:
date_default_timezone_set('UTC');

Đọc Tiếp...