Thursday, December 25, 2014

Basic Sql interview questions

How to find highest salary
How to find nth salary
What's the use of joins
Use of aggregate operations like min Max avg count ..
How to eliminate duplicate records
Use of inner and outer joins
Left right full outer joins
Basic crud operations in SQL example using create select insert delete
Use of in and between operations
Conditional statement in SQL
Use of views trigger and procedure
Group by having example
String operations
Inner and outer queries

Selenium webdriver interview questions

How to navigate between frames
Navigation between two window frames
Javascript Calendar validation
Select the dynamic elements using dynamic xpath
How to diff between Firefox chrome internet explore browser testing using webdriver
how to execute JavaScript using web driver
Implicit and explicit wait
Difference between selenium RC and webdriver
Use of selenium Grid
How to handle pop ups
How to select element with same of in two different places
How to test password
Data driven and keyword driven architecture

Algorithm coding interview questions

Following should be prepared before preparing interview for product/development base companies

Implement stack
Implementation of queue
Linked list implementation
Stack and queue implementation using linked list
Tree and binary tree implementation
Double linked list
Merge and quick sort
String operations
Arrays rotation
Search for integers in collection
Min, max and sum of elements

Friday, December 12, 2014

Fields for Selenium Testing

My form - Formoid html5 form

My form

Check boxes


Radio Buttons


Date Picker


Select File

Click on alert

Generics in Java

Generics:

Type Safety Objects: Allow one type of object, does not allow other object

No Casting required.

For example in Collection

List<String> list = new ArrayList<String>
Allow only string objects to List.

Map<String,Integer> map = new TreeMap<String,Integer>
Allow String and Integer to Map.


When we try to add number it will throw compile time.

General Generic Example

class Generic<T>{
T object;

void add(T object)
{
              this.object=object;
        }

T get()
{
            return object;
        }
public static void main(String[] args) {
     Generic<Integer> ingen = new Generic<Integer>();
     Generic<String> strgen = new Generic<String>();
 
     ingen.add(new Integer(11));
     strgen.add(new String("Generic"));

     System.out.printf("Integer =%d", ingen.get());
     System.out.printf("String =%s", strgen.get());
  }

}

Print Integer =11  String =Generic.

Thursday, December 11, 2014

How to find min Stack using min time

Number of Stacks: 2

Push: Push the items in S1 and Push the item to S2 if the item (top) is less than S1

Pop: Pop the item from S2 because its min value and compare with S1, if both are same then pop item from S1 also.

Popped item is min

Thursday, December 4, 2014

Advanced Selenium Web Driver Commands

Implicit Timeout in Web Driver:
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

Get text for Particular Element:
driver.findElement(By.id("ElementId")).getText())

Accept Alert:

  Alert alert = driver.switchTo().alert();
  String text = alert.getText();

Select Frame with Xpath.
   driver.findElement(By.xpath("(//a[contains(text(),'Frames')])[2]")).click();
driver.findElement(By.linkText("Small Window ("popup")")).click();

Selenium WebDriver baisc Commands

Initialize the Web Driver
       WebDriver driver = new FirefoxDriver();

Navigate to Web Page.
      driver.get("http://www.google.com");

Navigate to particular button and Click on It.
       driver.findElement(By.id("idname")).click();

Wait using driver Manage
       driver.manage().wait(3000);

Typing the Keys in TextBox.
       driver.findElement(By.id("userid")).sendKeys("bposthkseller1");

Click on Submit Button.
       driver.findElement(By.id("sgnBt")).submit();
       driver.manage().wait(3000);

Click on Link which contains Text.
       driver.findElement(By.linkText("Preferences")).click();

Click on Button with XPath Value.
       driver.findElement(By.xpath("//li[2]/span[2]/div")).click();