Showing posts with label selenium interview questions and answers. Show all posts
Showing posts with label selenium interview questions and answers. Show all posts

Monday, August 27, 2018

no image

Java Interview Questions For Selenium Webdriver - Business Office 1

PART 1

1 : What is object inwards java?

Answer : Object Is an Instance of degree in addition to it has its ain dry soil in addition to behavior. In existent footing nosotros tin say, Dog is object of Animal degree which accept unlike dry soil similar breed, color, name, hungry, etc in addition to behaviour  like wagging tail, fetching, barking etc.

2 : What is class?

Answer : H5N1 degree is the pattern or nosotros tin tell template from which private objects are created.

3 : What is constructor?

Answer : Constructor is a code block simply similar a method which is used to initialize the dry soil of an object. It volition live on invoked at the fourth dimension of object creation to gear upwardly the value for object. VIEW DETAIL

4 : What is default constructor?

Answer : If at that spot is non whatsoever constructor inwards degree hence coffee compiler creates default constructor. It is no declaration constructor which initializes whatsoever uninitialized fields to their default values.

5 : Constructor returns whatsoever value?

Answer : Yes. It volition provide event of electrical flow degree (However nosotros tin non role provide type amongst constructor).
no image

Interview Questions Of Gist Coffee For Selenium Webdriver - Business Office 2

Part 2

6 : What is the divergence betwixt static in addition to non static variable?

Answer : Main differences are equally bellow.
  • Static variables are preceded past times static keyword. For non-static variable, at that spot is non whatsoever preceding keyword.
  • Memory is allocated for static variables at the fourth dimension of flat loading. Memory is allocated to non- static variables whenever an object is created.
  • Memory is allocated alone ane time to static variables on flat loading. Memory is allocated multiple fourth dimension whenever a novel object is created to non-static variables.
  • Static variable instance : Collage lift of students, Company lift of employees..
READ MORE close static in addition to non-static stuff.

7 : What is the divergence betwixt static in addition to non static(Instance) method?

Answer : Difference betwixt static in addition to non static method is equally bellow.
  • Method declared alongside static keyword is static method. If Method declared without static keyword in addition to therefore it is instance method.
  • No postulate of object to telephone telephone static methods. Object needed to call instance method.
  • Can non access non static materials within static methods directly. Opposite to it, We tin access static in addition to non static materials straight inside instance method.
READ MORE detail on static in addition to non-static stuff.


8 : What is inheritance inward java?

Answer : In Java, Inheritance provides machinery using which ane object of little flat tin start  all the properties in addition to behaviors of bring upwards object. It volition crate IS-A relationship. Main usage of inheritance inward coffee is for code re-usability in addition to  method overriding to laissez passer on run-time polymorphism. VIEW MORE item on inheritance.

9 : Multiple inheritance is supported inward coffee on flat level? If No.. Why?

Answer : No.. Multiple inheritance is non supported inward coffee inward instance of flat to simplify the linguistic communication in addition to cut the complexity.

10 : What is method overriding inward java?

Answer : Method overriding is a characteristic which allows a little flat or sub flat to render a specific implementation of a method which is already provided past times ane of its bring upwards classes or super class. It is used for runtime polymorphism. You tin read to a greater extent than close method overriding on THIS POST.

Sunday, August 26, 2018

no image

Core Coffee Interview Questions For Selenium Webdriver - Occupation 3

Part 3

11 : Why principal method is static?

Answer : As nosotros know, We tin access static materials without creating object of class. Because of static keyword amongst principal method, Java virtual machine tin bespeak telephone band it without creating object of class. This agency it volition render sort of rootage to outset execution of program.

12 : What is method overloading?

Answer : Method overloading is might to practise multiple methods amongst same inwards same degree but amongst dissimilar signatures (different input parameters together with types). Method names volition endure same but parameters volition endure dissimilar for all overloaded methods.

13 : What is constructor overloading?

Answer : Same every bit method overloading, Single degree tin bring multiple constructors amongst same advert every bit degree advert but all bring dissimilar signatures (different input parameters together with types) is called constructor overloading. READ MORE most constructor overloading.

14 : Can nosotros override static methods?

Answer : We tin declare static method amongst same signature inwards subclass but it volition non deport every bit overridden method. So response is No.. We tin non override static methods every bit they are business office of  class non object.. You tin override static methods but output volition endure dissimilar than the expected.

15 : How to contrary string inwards java?

Answer : StringBuffer degree has a method called reverse(). We tin piece of occupation it to contrary the string.
Example :

populace static void main(String[] args) {
// buffer string using StringBuffer class.
StringBuffer a = novel StringBuffer("I similar coffee real much.");
// piece of occupation reverse() method to contrary string
System.out.println(a.reverse());
}

no image

Frequently Asked Coffee Interview Questions Business Office - 4

Part 4

16 : Can nosotros overload static methods? 

Answer : Yes.. There is non whatsoever restriction to overload static methods. We tin post away overload static together with non static methods inwards java. VIEW MORE on overloading inwards java.

17 : Can nosotros operate somebody fellow member of bring upwardly class inwards sub class?

Answer : No.. It volition non permit to operate somebody members similar somebody method, variable of bring upwardly class inwards little class. Private members are accessible solely within same class. VIEW MORE close class modifiers.

18 : What is an interface inwards java?

Answer : An interface is a bluish impress of a class which tin post away concur abstract methods (Methods without implementation) only. It creates Rules To Follow construction for class where It Is Implemented. We tin post away make 100% abstraction using interface inwards java. READ MORE close interface inwards java.

19 : Can nosotros access protected method of bring upwardly class inwards sub class? 

Answer : Yes.. We tin post away access protected members of bring upwardly class inwards all it's sub classes together with classes within the same package. VIEW EXAMPLE on how to access protected method inwards sub class.

20 : What is an array inwards java?

Answer : An array is container object inwards coffee which tin post away concur fixed give away of values of same type. VIEW ARTICLE on array.

Saturday, August 25, 2018

no image

Java Questions For Selenium Webdriver Interview

Part 5

21 : Explain System.out.println();

Answer :
  • System : is a concluding shape in  java.lang package.
  • out : is a static fellow member of arrangement class. It is an illustration of java.io.PrintStream. This current is already opened upward as well as reach to get got output data.
  • println : is a method of java.io.PrintStream .It is an overloaded method.

22 : Write programme to print fibonacci series 0, 1, 1, 2, 3, 5, 8, 13, 21,... 

Answer :
public shape fibonaccci {   world static void main(String[] args) {   int f1 = 0;   int f2 = 1;   int amount = 0;   for(int i=0; i<=21;){    System.out.println(f1);    amount = i+f2;    f2=i;    f1=sum;    i=f1;   }  } }

23 : Write programme to larn lawsuit of 52+42-32+22-12  

Answer :
public shape SquareSum {   world static void main(String[] args) {      int amount = 0;     for (int i=5;i>=1;i--){          if(i%2!=0){     if(sum<(i*i)){      amount = (i*i)-sum;     }else{      amount = sum-(i*i);     }        }else{         amount = sum+(i*i);    }       }   System.out.println(sum);  } }

24 : What is supply type of testng @DataProvider musical note method? 

Answer : It volition supply double object array “Object[][]”.

25 : int x=10 as well as y=20. Swap both variable values without using whatever temp variable.

Answer :
public shape swapNumbers {   world static void main(String[] args) {      int x = 10;   int y = 20;      System.out.println("Before swapping x = " + x + " as well as y = " + y);    x = x + y;   y = x - y;   x = x - y;    System.out.println("After swapping x = " + x + " as well as y = " + y);  } }

no image

What Is Purpose Of Super Keyword Inwards Java?

Earlier nosotros stimulate got talked almost method overriding concept inwards coffee during THIS POST to modify the implementation of nurture class's method inwards sub class. In inheritance, Super keyword is used to refer object of immediate nurture class. Generally nosotros are using super keyword inwards inheritance for 3 unlike purpose. Let's run across how as well as when to usage super keyword inwards java. Interviewer tin enquire yous this query as well as then delight sympathise how it works.

super keyword usage
  1. To refer to the variable of nurture class.
  2. To invoke the constructor of immediate nurture class.
  3. To refer to the method of nurture class.
Let's stimulate got 1 illustration to sympathise higher upwards 3 things. We stimulate got nurture course of teaching Animal and it's sub class Elephant as bellow.

Animal.java
public course of teaching Animal {  int age = 40;  Animal(){   System.out.println("Animal is moving.");  }    void welcome(){   System.out.println("Welcome to Animal class.");  } }



Elephant.java
public course of teaching Elephant extends Animal {  int age = 100;   Elephant() {   // To invoke nurture course of teaching constructor Animal().   super();   System.out.println("Elephant is running.");    welcome();   // Used super.welcome() to telephone band nurture course of teaching method.   super.welcome();  }   void showAge() {   System.out.println("Average historic menstruum of Elephant : " + age);   // Used super.age to access nurture course of teaching variable value.   System.out.println("Average historic menstruum of Animals : " + super.age);  }   void welcome() {   System.out.println("Welcome to Elephant class.");  }   populace static void main(String[] args) {   Elephant c = novel Elephant();   c.showAge();  } }

Output
Animal is moving. Elephant is running. Welcome to Elephant class. Welcome to Animal class. Average historic menstruum of Elephant : 100 Average historic menstruum of Animals : 40

In higher upwards illustration yous tin run across that nosotros stimulate got used
  1. super.age to refer nurture course of teaching variable age.
  2. super() to invoke immediate nurture course of teaching constructor Animal() and
  3. super.welcome() to access nurture course of teaching method.
This means yous tin invoke constructor of nurture course of teaching inwards to tyke course of teaching or access nurture course of teaching variable or method when same advert method or variable is available inwards tyke class.

<< PREVIOUS || NEXT >>
no image

Interview Questions On Coffee For Selenium

Part 6

26 : What is local variable inwards java?
Answer : Local variable is declared within method or constructor too it is express for that method or constructor only. View more detail on local variable inwards java.

Local Variable Example :
public flat JavaVariable {   world void Calc() {   // Local Variables.   int sum;   int item1 = 5;   int item2 = 7;   amount = item1 + item2;   System.out.println("Sum is : " + sum);  }   world static void main(String args[]) {   JavaVariable j = novel JavaVariable();   j.Calc();  } }



27 : What is a Instance Variable inwards java?
Answer : Instance Variable is declared parallel to method or constructor inwards class. It is visible for all methods too constructors of that class. View more detail on instance variable inwards java.

Instance Variable Example :
public flat JavaVariable {  //Instance Variable.  int sum;   world void Calc() {   // Local Variables.   int item1 = 5;   int item2 = 7;   amount = item1 + item2;   System.out.println("Sum is : " + sum);  }   world static void main(String args[]) {   JavaVariable j = novel JavaVariable();   j.Calc();  }

28 : What is a Class Variable inwards java?
Answer : Class variable is declared alongside static keyword inwards flat parallel to methods too constructor. Class variable is initialized solely ane time at the kickoff of execution too destroyed on cease of program. Class variable is too known every bit static variable. View more detail on flat variable inwards java.

Class Variable Example :
public flat JavaVariable {  //Class Variable  static String sumType = "Basket";   //Instance Variable.  int sum;   world void Calc() {   // Local Variables.   int item1 = 5;   int item2 = 7;   amount = item1 + item2;   System.out.println(sumType + " Sum is : " + sum);  }   world static void main(String args[]) {   JavaVariable j = novel JavaVariable();   j.Calc();  }

29 : What is the deviation between instance variable too flat variable?
Answer :

Instance Variable :
  • It is unique to each illustration of the class.
  • Declared without static modifier.
  • Memory allocation, loading too initialization is done at piece of job time.
Static Variable :
  • It is shared past times all instances of the class.
  • Declared alongside static modifier.
  • Memory allotment is done at compile time, loaded at charge fourth dimension too they are initialized at flat initialization time.
30. What is access modifier inwards java?
Answer : Access modifiers allows us to gear upwards access levels for variables, methods, classes too constructors inwards java. We tin command access levels using access modifiers inwards java. View more details on dissimilar access modifiers inwards java.

Friday, August 24, 2018

Java Programming Interview Questions

Java Programming Interview Questions

Part 7

31 : What is default value of local variable.
Answer : There is non whatsoever default value of local variable. You must accept to initialize it. View more details on local variables inwards java.

32 : Java back upwards constructor inheritance?
Answer : No, Constructor inheritance is non supported inwards java. View more details on constructor inwards java.

33 : Which is super shape of all other classes inwards java?
Answer : java.lang.Object is  super shape of all other classes inwards java.

34 : What is Encapsulation?
Answer : Encapsulation is procedure of packing code together with information together In to a unmarried Unit. View more details on Encapsulation in java.

35 : Write a plan to opposite a string without using opposite function.
Answer : Program to opposite a string without using opposite business office inwards coffee is every bit bellow.

package JAVAExamples;  populace shape StringReverse {  populace static void main(String[] args) {     //String to reverse.   String str = "This Is String.";   String revstring = "";    for (int i = str.length() - 1; i >= 0; --i) {    //Start getting characters from terminate of the string.    revstring += str.charAt(i);   }    System.out.println(revstring);  } }

Output : .gnirtS sI sihT
no image

Java Questions For Selenium Interview

Part 8

36 : What is the difference betwixt the Constructor together with Method?
Answer : Main departure betwixt the Constructor together with Method is equally bellow.

Constructor :
  1. Name of the constructor must live on same equally cast name.
  2. Constructor must non accept whatever supply type.
  3. It is used to initialize the set down of an object.
  4. It is non possible to telephone phone constructor directly. Constructors called implicitly when the novel keyword creates an object.
Method :
  1. Method elevate tin live on any.
  2. Method must accept supply type.
  3. It is used to let on demeanor of an object.
  4. Methods tin live on called directly.
Read to a greater extent than on Constructor together with Method.

37 : What are the unlike types of types of constructors inwards java?
Answer : Mainly in that place are ii types of constructors available inwards java.
  • Default Constructor : Constructor without parameter is called default constructor.
package JAVAExamples;  populace cast City {  //Default Constructor  City()  {   System.out.println("City is created");  }    populace static void main(String args[]){     City c=new City();    }   }
  • Parameterized constructor : Constructor amongst parameter is called Parameterized constructor.
package JAVAExamples;  populace cast City {  int id;  String name;   // parameterized Constructor  City(int i, String n) {   id = i;   elevate = n;  }   void display() {   System.out.println(id + " " + name);  }   populace static void main(String args[]) {   City c1 = novel City(1, "New York");   City c2 = novel City(2, "London");   c1.display();   c2.display();  } }
Output :
1 New York
2 London

38 : Write a programme for Fibonacci serial inwards Java ?
Answer : Program for Fibonacci serial is equally bellow.

package JAVAExamples;  populace cast FibonacciSeries {  populace static void main(String args[]) {   int x1 = 0, x2 = 1, x3, i, cnt = 15;   // To impress 0 together with 1   System.out.print(x1 + " " + x2);    // loop starts from 2 equally 0 together with 1 are already printed.   for (i = 2; i < cnt; ++i) {    x3 = x1 + x2;    System.out.print(" " + x3);    x1 = x2;    x2 = x3;   }  } }

39 : Write a programme to impress below given pattern.

1  1 2  1 2 iii  1 2 iii iv  1 2 iii iv 5

Answer : Program to impress to a higher house designing is equally bellow.

package JAVAExamples;  populace cast Pattern {   populace static void main(String[] args) {   for (int a = 1; a <= 5; a++) {    for (int x = 1; x <= a; x++) {     System.out.print(x+" ");    }    // To impress novel line.    System.out.println();   }  } }

40. What is the departure betwixt “this” together with “super” keywords inwards Java?
Answer : Difference is equally bellow.
  1. “this” keyword is used to shop electrical current object reference while “super” keyword is used to store super cast object inwards sub class..
  2. “this” is used to access methods of the electrical current class while “super” is used to access methods of the base of operations class.
  3. this() used to telephone phone constructors inwards the same cast whereas super() is used to telephone phone super cast constructor.
Read more on “super” keyword.
no image

Java Questions Too Answers For Selenium

Part 9

41 : In java, What is provide type of principal method?
Answer : Main method doesn't bring whatever provide type. It is void.

42 : Can We Overload principal method inward java?
Answer : Yes, Java degree tin bring whatever seat out of principal methods as well as hence it is possible to overload principal method. But when you lot run program, It volition non execute overloaded principal method. Always It volition execute exclusively world static void main(String[] args) method.

43 : Can nosotros declare degree equally protected?
Answer : No, You tin non declare degree equally protected.

44 : Write a programme to take given grapheme from string.
Answer : Program to take given grapheme from string is equally bellow.

package JAVAExamples;  world degree RemoveChar {    world static String removeChar(String str, char c) {      if (str == null)          provide null;      provide str.replaceAll(Character.toString(c), "");  }    world static void main(String[] args) {   System.out.println(removeChar("chicago", 'c'));  } }

45 : How to convert string from upper to lower as well as lower to upper case?
Answer : You tin use toUpperCase as well as toLowerCase methods to convert string from lower to upper as well as upper to lower case.
no image

Interview Questions Inwards Coffee For Selenium

Part 10

46 : What is Polymorphism?
Answer : Polymorphism is might using which nosotros tin usage reference variables or methods which behaves differently inwards dissimilar programmatic context. Best illustration of polymorphism is human. We behaves differently amongst dissimilar people inwards dissimilar environment. Our behaviour volition hold upward dissimilar when nosotros reckon to boss in addition to reckon to friend. Read more on Polymorphism inwards java.

47 : What is the advantages of Polymorphism?
Answer : Main payoff of polymorphism is code reusabilty. You tin dynamically provide dissimilar implementations through polymorphism. So it volition trim your travel book inwards damage of treatment in addition to distinguishing diverse objects.

48 : What is a package?
Answer : Influenza A virus subtype H5N1 bundle is a namespace which allows developer to organizes a grouping of related classes in addition to interfaces. Conceptually it is but similar folder which contains dissimilar types of files. It is slow to continue things organised past times keeping related classes in addition to interfaces into packages.

49 : What is string inwards java?
Answer : In Java programming, String is object which is prepared past times sequence of characters.java.lang bundle has String shape to usage in addition to manipulate strings. Read more on string inwards java.

50 : What is StringBuffer inwards java?
Answer : StringBuffer assistance us to usage mutable(modifiable) string inwards java. That agency nosotros tin alter the string if nosotros purpose StringBuffer.
<< PREVIOUS || NEXT >>

Thursday, August 23, 2018

no image

Appium Interview Questions Alongside Answers

1. : What Is Appium?
Answer : Appium is an opened upward root mobile application automation testing tool. Using appium, We tin laissez passer on the axe automate native applications, Mobile spider web applications in addition to mobile hybrid applications on Android in addition to IOS platforms. VIEW MORE DETAIL

2. : What are the prerequisites to install appium inward windows?
Answer : You postulate to install few software earlier install in addition to purpose appium inward windows. Bellow given software are required to install appium inward windows.

  1. Java JDK in addition to set JAVA_HOME. VIEW DETAIL
  2. Android SDK(API Level >= 17)(VIEW DETAIL) in addition to set ANDROID_HOME(VIEW DETAIL).
  3. Microsoft .Net Framework, Node JS in addition to PDANet+ for Android(optional). VIEW DETAIL.
  4. Also you lot postulate other software, customer libraries in addition to jounce files similar Eclipse IDE amongst testng installed, Selenium Server JAR, Webdriver Language Binding Library, APPIUM for Windows.
3. : Appium is cross platform or platform independent?
Answer : Appium is cross platform software automation testing tool. You tin laissez passer on the axe write software automation tests for multiple platforms similar Android, IOS using same API of Appium.

4. : What is principal payoff of cross platform back upward of Appium?
Answer : Using cross platform back upward of Appium, You tin laissez passer on the axe cut down your software automation test-suite's code size every bit you lot tin laissez passer on the axe reuse code betwixt Android in addition to IOS test-suites.

5. : In which linguistic communication appium is written?
Answer : Appium server is written inward Node.js. You tin laissez passer on the axe install it straight from Node Package Manager(NPM) or you lot tin laissez passer on the axe fix in addition to install it from source.
no image

Interview Questions For Appium


6. : What is Node.js?
Answer : It is cross-platform runtime surround which is used to railroad train server-side software spider web applications. It is open-source thus you lot tin mail away purpose it without whatever cost.


7. : What is Desired Capabilities as well as how it is used inward Appium software testing tool?
Answer : Desired Capabilities is bunch of keys as well as it's value. Using this prepare of keys as well as values nosotros tin mail away tell to appium server that what sort of automation session nosotros are going to create. Example : If you lot prepare platformName = Android thus appium volition sympathise that you lot wants to practice automation session to run examination on Android.

8. : Tell me appium supported platforms to run automation tests.
Answer : VIEW ANSWER.

9. : Is at that topographic point whatever agency to access Android SDK tools from eclipse?
Answer : Yes, You tin mail away access Android SDK tools from eclipse using it's ADT Plugin. VIEW MORE

10. : Why appium?
Answer : There are principal 3 reasons to purpose appium inward mobile software automation.
  • When you lot perform software automation examination using appium, It is non required to alteration or recompile your software app every bit appium purpose criterion software automation APIs on all platforms.
  • You tin mail away write automation tests for mobile software app inward your favorite  WebDriver-compatible linguistic communication similar java, C#, PHP, Python etc.
  • Appium allows you lot to purpose whatever testing framework.
no image

Latest Appium Interview Questions

11. : How to configure android device to survive software examination using appium inward devices?
Answer : In guild to survive software automation tests using appium inward android device, You withdraw to enable USB debugging inward your android device. VIEW DETAILS on how to enable USB debugging inward android device.

12. : Tell me the ascendancy cite for windows to verify that android device is connected amongst PC.
Answer : You tin plough over the axe survive adb devices ascendancy inward windows to brand certain that device is connected properly amongst PC to survive appium tests on it.

13. : Appium back upwards multiple languages?
Answer : Yes, Appium back upwards multiple languages to practise examination cases. List of appium supported languages is given on THIS PAGE.

14. : Which tool you lot are using to locate elements of android software app? How to role it?
Answer : I am using UI Automator Viewer tool which is provided past times android SDK to locate elements of android app. How to role it exceptional is given on THIS PAGE.

15. : Can nosotros locate android app's elements from emulator using UI Automator Viewer tool?
Answer : Yes, UI Automator Viewer tool back upwards physical android devices equally good equally android emulators as well as thus you lot tin plough over the axe role it to inspect app's elements from android emulators too.
no image

Appium Android Interview Questions

16. : Can you lot enjoin me few appium limitations?
Answer : Limitations Of Appium are described on THIS PAGE.

17. : Tell me dissimilar ways to locate android app elements inwards appium automation.
Answer : You tin locate android app's elements using bellow given dissimilar ways.
  1. XPath
  2. ID
  3. Name
  4. className
  5. AccessibilityId
18. : Can you lot enjoin me dissimilar ways to locate chemical gene past times XPath?
Answer : You tin practice XPath inwards dissimilar ways to locate same element. Different XPath examples are given on THIS PAGE.

19. : What is role of package in addition to launcher action advert of android app inwards appium automation test?
Answer : In appium automation test, We demand to render android app's parcel in addition to launcher action advert in addition to thus that appium tin empathize which application to launch for testify when you lot foremost running appium test. We tin gear upwards parcel in addition to launcher action advert equally desired capability.

20. : How to transcend android app's package in addition to launcher activity name?
Answer : There are many dissimilar ways to transcend android app's package in addition to launcher activity name. I convey described two dissimilar ways to transcend android app's package in addition to launcher activity name. Other 2 ways are given on THIS PAGE too.

Wednesday, August 22, 2018

no image

Latest Interview Questions For Android App Automation

21. : Which android version is supported yesteryear appium?
Answer : Appium support Android 17+ API marker versions only. You demand to role selendroid if yous accept older version of android API level. View MORE DETAILS.

22. : How to configure appium projection inwards eclipse?
Answer : Appium projection configuration steps are given on THIS PAGE.
23. : What are the different desired capabilities required to function appium test?
Answer : In lodge to function appium test, You demand to define bellow given desired capabilities. You tin go VIEW EXAMPLE on how to fix desired capabilities inwards appium software automation test.

  • deviceName
  • BROWSER_NAME
  • VERSION
  • platformName
  • appPackage
  • appActivity
24. : Can nosotros function iOS automation exam inwards windows using appium?
Answer : No, You tin go non function iOS automation exam inwards windows every bit Appium relies on OS X-only libraries to back upwards iOS testing. You tin go use Remote Server selection to connect to appium server which is running on MAC.

25. : Is it possible to function android appium exam inwards emulator?
Answer : Yes, You tin go function android appium software automation inwards existent device every bit good inwards emulators too. VIEW EXAMPLE on how to function android software automation tests inwards emulator using appium.