Getting Applet Parameters

The following example demonstrates how to make an applet respond to setup parameters specified in the document. This applet displays a checkerboard pattern of black and a second color. The second color and the size of each square may be specified as parameters to the applet within the document. CheckerApplet gets its parameters in the…

Dynamic Table

import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; public class Dynamictable { WebDriver driver = new FirefoxDriver(); @BeforeTest public void setup() throws Exception { driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); driver.get(“http://only-testing-blog.blogspot.in/2014/05/form.html”); } @AfterTest public void tearDown() throws Exception { driver.quit(); } @Test public void Handle_Dynamic_Webtable() { //To locate…

Java Uses- Builder Pattern

Builder pattern is used to create a complex object using simple objects. It creates the bigger object step by step from small and simple object. Builder pattern is another creational pattern. For example, when creating a window as our application’s main window, we need to create a menu, a toolbar and then add the menu…

Scala uses

In Scala, you can define variables val and lazy val. Scala allows you to decide, when you can declare variable immutable whether or not.          Val This is immutable variable declared with the key word val. It means, we cannot change variable. The following code can creates a value with the name…

Singleton Object

Method- public class SingleObject { //create an object of SingleObject private static SingleObject instance = new SingleObject(); //make the constructor private so that this class cannot be //instantiated private SingleObject(){} //Get the only object available public static SingleObject getInstance(){ return instance; } public void showMessage(){ System.out.println(“Hello World!”); } } Call method- public class SingletonPatternDemo {…