learncodingforfree.com

JAVA PROGRAM TO FIND THE FACTORIAL OF A NUMBER

  The  factorial   of  a   number   is    the   multiplication  of  all  positive  integers  from  1   to  that  number .      Factorial  of  number  n   is  represented  as  n!         Formula  for  Factorial :     n!=n*(n-1)*(n-2)*(n-3)*……………*1   Example :  5!=5*4*3*2*1=120 6!=6*5*4*3*2*1=720           Iterative  Approach :   […]

JAVA PROGRAM TO FIND THE FACTORIAL OF A NUMBER Read More »

JAVA PROGRAM TO FIND THE SUM OF THE DIGITS OF A NUMBER

  Example :  Input: 987 Output: 9+8+7=24     Java program   public  class  SumofDigits {          public  static   void   main(String  args[] ) {          int  num, digit,sum=0;          Scanner  sc=new  Scanner(System.in);          System.out.println(“Enter  a  number “);          int   num=sc.nextInt();

JAVA PROGRAM TO FIND THE SUM OF THE DIGITS OF A NUMBER Read More »

JAVA PROGRAM TO PRINT THE PRIME NUMBERS FROM 1 TO N.

            A  prime  number  is  a  whole  number greater  than  1  which  is  only  divisible  by  1  &  the  number  itself i.e. A  prime  number  can’t  be  divided  by  other  numbers  except  1  &  the  number   itself.   e.g. 2,3,5,7,11,13,17,19 …..etc.       Approach : According  to  definition, number

JAVA PROGRAM TO PRINT THE PRIME NUMBERS FROM 1 TO N. Read More »

JAVA PROGRAM TO CHECK IF TWO STRINGS ARE ANAGRAM OR NOT

  Two   Strings  are  said  to   be   anagram   if   you   can  form  one  string   by  arranging  the  characters   of  another  string .  For  example :  Earth  and  Heart , Care  and  Race, Keep  and Peek  etc.       Approach :   In  this  approach ,  the  idea  is  that  if  two  strings  are  anagram,

JAVA PROGRAM TO CHECK IF TWO STRINGS ARE ANAGRAM OR NOT Read More »

HOW TO HANDLE DYNAMIC ELEMENTS IN SELENIUM

  Dynamic  elements  are  web  elements  which  are  dynamically   generated   during  runtime .  Dynamic  identifiers  can  be  for  any  web elements  of  the  web  page  but  normally  used  for  buttons ,  text fields  etc.     e.g. <button  id=”Submit-901″/> <button  id=”Submit-902″/> <button  id= “Submit-903″/>     Handling  dynamic  ekements  in  Selenium  involves  using  flexible  locators  and 

HOW TO HANDLE DYNAMIC ELEMENTS IN SELENIUM Read More »

SYNCHRONIZATION IN SELENIUM

  Synchronization  in  Selenium  is  the  process   of  matching  the   execution  speed  of  the  test  script  with  the  loading   speed   of  the  application   under  test .  Synchronization  prevents  errors  such  as  NoSuchElementException   .           How  to  achieve  synchronization   in  the  Selenium   WebDriver ?     Synchronization  in  selenium  is  very  important 

SYNCHRONIZATION IN SELENIUM Read More »

SELENIUM XPATH

    XPath (XML Path  )  is  a  powerful  Selenium  locator   strategy  which   are  used  to  navigate  and    find   elements   in  a   web    page’s   HTML   structure .        What  is  XPath?     Xpath  is  XML  Path  language  which  is  an  expression  language  that   is  used   to   find  the  web  elements

SELENIUM XPATH Read More »

Java Collections Framework

  Java  collection  framework   is  a  set  of   classes  and  interfaces  that  provides  built-in   data  structures   to   store  and  manipulate  groups  of  objects  efficiently  . This  java  collection  framework  is  found  in  java.util  package. Java  collection  framework   allows  you  to  manage   data  efficiently  through  high  performance   data  structures   and   polymorphic  algorithms   like   searching  and  sorting.

Java Collections Framework Read More »

JAVA MULTITHREADING

  Multhreading  in  Java  is  a   process  that  enables   a  program  to  run  multiple   threads   simultaneously , allowing  multiple  tasks   to  execute  in   parallel   and  utilize  the  CPU  more  efficiently .   A   thread  is  an  independent , lightweight  unit of   execution   inside  a  java  program .       Threads  allow   parallel  execution    of 

JAVA MULTITHREADING Read More »

LOCATORS IN SELENIUM

  Selenium  locators  are  used  to  uniquely  identify  the  HTML  elements  and  interact  with  these  HTML  elements such as  button,text  boxes , links  etc. in  the  Document  Object  Model (DOM)  during  automation.           Selenium  WebDriver  supports  8  primary  locator  types  through  the  By  class.   ID:  This  locator  locates  the  elements 

LOCATORS IN SELENIUM Read More »