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();