Quality Testing

Quality is delighting customers

Selenium - Understanding JAVA

Understanding Java for Selenium:
All the java files that is written inside eclipse can be opened inside a notepad and it is saved as a .java file under the src folder inside the project folder inside the workspace.Any java file inside eclipse will contain a main method inside the java class. This main method triggers all the other methods written by the user in java. The userdefined java methods can be written either outside main method and called inside main method but cannot be written inside the main method.The class file of Java file is stored inside the bin folder of any project. This class file can be executed on any platform and is the file that gets executed whenever you run the Java file whether inside the eclipse or from command prompt.You can create a java file on windows operating system and can deploy/run it on linux server.

Datatype in Java:
Java keywords example: Public, Class, int, void etc....
Int represents the integer datatype.
Long can also be used to store integers. 
Double represents the decimal values.
char represents only one letter, can be of any language.
boolean can take only true or false. (used in if statement). When you have a condition to be checked and the result of the condition needs to be displayed then we can use the boolean datatype.

Operators in Java:
>,<,>=,<=,==,=,!=

Why use eclipse when you can write it in Notepad?
Because notepad does not give you options to track the issues with the scripts when you write a code also there is no debug view in notepad.Hence we use eclipse.shortcut in eclipse for statement completion is crtl+spacebar.

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2021   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service