This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MainClass { | |
public static void main(String args[]) { | |
BmwCar bmw = new BmwCar(); | |
bmw.getPrice(); | |
bmw.changeGear(4); | |
bmw.speedUp(60); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HondaCar { | |
int price = 100000; | |
public void getPrice(int price) { | |
System.out.println("The price of the Honda car is:" + price); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class AudiCar { | |
int price = 500000; | |
public void getPrice(int price) { | |
System.out.println("The price of the car is:" + price); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BmwCar extends Car { | |
int price = 100000; | |
public void getPrice(int price) { | |
System.out.println("The price of the car is:" + price); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Car { | |
//Below 2 fields are states | |
int gear = 0; | |
int speed = 0; | |
//All below methods are behaviors | |
void changeGear(int newValue) { | |
System.out.println("Changing the gear to:" + newValue); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form action="/my-handling-form-page" method="post"> | |
<div> | |
<label for="name">Name:</label> | |
<input type="text" id="name" /> | |
</div> | |
<div> | |
<label for="mail">E-mail:</label> | |
<input type="email" id="mail" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestNG] Running: | |
C:\Users\username\AppData\Local\Temp\testng-eclipse-1346797963\testng-customsuite.xml | |
This is a @BeforeSuite annotated method and this is executed at the beginning of the test suite execution | |
This is a @BeforeClass annotated method and this is executed at the beginning of the test class execution | |
This is a @BeforeMethod annotated method and this is executed at the beginning of the each test method | |
This is a @test annotated method and your testing will be done here | |
This is a @AfterMethod annotated method and this is executed at the end of the each test method | |
This is a @BeforeMethod annotated method and this is executed at the beginning of the each test method | |
This is a @test annotated method and your testing will be done here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.annotations.example; | |
import org.testng.annotations.*; | |
public class TestNgAnnotations { | |
@BeforeSuite | |
public void beforeSuite() { | |
System.out.println("This is a @BeforeSuite annotated method and this is executed at the beginning of the test suite execution"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.selenium.webdriver; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
import org.testng.annotations.AfterMethod; | |
import org.testng.annotations.BeforeMethod; | |
import org.testng.annotations.Test; | |
public class WebdriverDemo | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.firefox.FirefoxDriver; | |
public class DriverFactory | |
{ | |
private DriverFactory() | |
{ | |
//Do-nothing..Do not allow to initialize this class from outside | |
} |
NewerOlder