1 — DIMENSIONAL Array

// Initializing array

datatype[] varName= new datatype[size];

// Declaring

datatype[] varName= new type[]{values1, value2,…};

Array with Random Variables

double[] a = new double[n];

for(int i=0; i<n;i++)

{

a[i] = Math.random();

}

Maximum value in an Array

double max = 0;

for(int i=0; i<a.length;i++)

{

if(a[i] > max){

max = a[i]; }

}

Reversing an Array

for(int i=0; i<(a.length())/2;i++){

double temp =arr[i];

arr[i]=arr[n-1-i];

arr[n-1-i]=temp;

}

MULTI — DIMENSIONAL ARRAYS

// Initializing

datatype[][] varName = new datatype[row][col];

// Declaring

datatype[][] varName = {{value1, value2…},{value1, value2…}…};

Transposing a Matrix

for{i = 0; i<row;i++){

for(j = 0; j<column;j++){

System.out.print(array[i][j]+” “); }

System.out.println(“ ”);

}

Multiplying two Matrices

for{int i = 0; i<row;i++){

for(int j=0;j<col2;j++){

for(k=0;k<row2;k++){

sum = sum + first[i][k]*second[k][j];

}

multiply[i][j] = sum;

sum = 0; }

}

Hope this article helped to understand Basic Array programs.

Thanks for reading!!!!

--

--

  1. Test cases should have very good test case coverage.
  2. Test Cases should have good coverage with less no. of steps.
  3. Test Case should be written by applying test case design techniques.
  4. Test Case should be simple to understand.
  5. If test cases given to any new Tester, he/ she should be able to execute the test cases without asking any questions or clarifications.
  6. Test Case should be written in test case template.
  7. Test Case should be consistent, means flow or sequence should be good.
  8. Test Case should consists of both positive and negative scenarios.
  9. Test cases should be able to catch the defects.
  10. Test cases should not be redundant, means no duplicates.
  11. Test Cases should be very easy to convert into Automation scripts.

These are the characteristics of Good Test Case.

Thanks for reading my article.

Happy Testing !!!!

--

--

Methods of SearchContext interface :

  1. findElement()
  2. findElements()

Methods of WebDriver interface :

  1. close()
  2. get()
  3. getTitle()
  4. getPageSource()
  5. getCurrentUrl()
  6. getWindowHandle()
  7. getWindowHandles()
  8. manage()
  9. navigate()
  10. quit()
  11. switchTo()

Methods of TakeScreenshot Interface:

  1. getScreenshotAs(args)

Methods of JavascriptExecutor interface :

  1. executeScript()
  2. executeAsyncScript() — we don't use this for automation

Methods of WebElement interface :

  1. clear()
  2. click()
  3. getAttribute()
  4. getCssValue()
  5. getLocation()
  6. getRect()
  7. getSize()
  8. getTagName()
  9. getText()
  10. isDisplayed()
  11. isEnabled()
  12. isSelected()
  13. sendKeys()
  14. submit()

--

--

Sri Priya P Kulkarni

Sri Priya P Kulkarni

SDET| Blogger! | Automation Enthusiast! | On a journey of Continuous learning.... !