Showing posts with label "how to set selenium up selenium with java". Show all posts
Showing posts with label "how to set selenium up selenium with java". Show all posts

What is the difference between absolute and relative Xpath?


Absolute Xpath : 

1) start selection from the document node
2) Starts with //
3) e.g. “/html/body/p” matches all the paragraph elements

Google Search Box : /html/body/div[1]/div[2]/div[1]/div[1]/div[3]/div/div/div/form/fieldset[2]/div/div/div

Relative Xpath  : 

1) start selection matching anywhere in the document
2) Starts with /
3) e.g. “//p” matches all the paragraph elements starts with p

Google Search Box : //*[@id='gbqfqwb']

How to setup Classpath for Java in Windows 7?



We all know the importance of CLASSPATH for Java. Setting PATH/CLASSPATH is very easy if we have the correct steps. I've listed down the steps which will help you to set CLASSPATH/PATH for Java:
 
Step 1: Download Java or JDK from the following URL according to your computer configuration:
Step 2: Install it by click on setup.exe and following the steps.
Step 3: By default JDK installs at "C:\Program Files\Java\jdkxxx.xx" location only. Unless we change the location at the time of installation.
Step 4: Go to JDK installed location, open bin folder available at the location. Now, copy the path.
Step 5: Right-click on My Computer icon available at your desktop and select Properties.
Step 6: Now, click on Advanced System Settings and click on Advanced tab from the dialog box opened
Step 7: Click on Environment Variables and then System Variables.

Step 8: Edit path and add the copied bin (which we did in Step 4) in that. Below are some images to help you:



Step 9: Click on OK of Environment Variables window and System Properties window.
Step 10: To verify whether Classpath or path of java is set up correctly or not.

Open Command Prompt and enter java -version. You'll find a statement like mentioned below:

java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)