1. Tell about roles and responsibilities of the current project.
2. Day to day activities of current project.
3. Java code for count the number of occurrence of each letter.(aabbbccccddd)
4. Project flow
5. Selenium web driver : multi threading concept
6. Compatibility test in different browsers
http://automationtestingutilities.blogspot.com/2013/11/multi-browser-testing-using-selenium.html
7. Data driven framework concept.
http://software-testing-tutorials-automation.blogspot.com/2014/07/create-data-driven-framework-for.html
8. How you write the test suit
Test suite is a collection of test cases that are intended to test a behavior or set of behaviors of software program. In
TestNG, we cannot define a suite in testing source code, but it is represented by one XML file
Test suite is a collection of test cases that are intended to test a behavior or set of behaviors of software program. In
TestNG, we cannot define a suite in testing source code, but it is represented by one XML file
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Suite1"> <test name="exampletest1"> <classes> <class name="Test1" /> </classes> </test> <test name="exampletest2"> <classes> <class name="Test2" /> </classes> </test> </suite>
9. TestNG methods, which I used in my project
@BeforeSuite: The annotated method will be run before all tests in this suite have run.
@AfterSuite: The annotated method will be run after all tests in this suite have run.
@BeforeTest: The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.
@AfterTest: The annotated method will be run after all the test methods belonging to the classes inside the <test> tag have run.
@BeforeGroups: The list of groups that this configuration method will run before. This method is guaranteed to run shortly before the first test method that belongs to any of these groups is invoked.
@AfterGroups: The list of groups that this configuration method will run after. This method is guaranteed to run shortly after the last test method that belongs to any of these groups is invoked.
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.
@AfterClass: The annotated method will be run after all the test methods in the current class have been run.
@BeforeMethod: The annotated method will be run before each test method.
@AfterMethod: The annotated method will be run after each test method.
@BeforeSuite: The annotated method will be run before all tests in this suite have run.
@AfterSuite: The annotated method will be run after all tests in this suite have run.
@BeforeTest: The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.
@AfterTest: The annotated method will be run after all the test methods belonging to the classes inside the <test> tag have run.
@BeforeGroups: The list of groups that this configuration method will run before. This method is guaranteed to run shortly before the first test method that belongs to any of these groups is invoked.
@AfterGroups: The list of groups that this configuration method will run after. This method is guaranteed to run shortly after the last test method that belongs to any of these groups is invoked.
@BeforeClass: The annotated method will be run before the first test method in the current class is invoked.
@AfterClass: The annotated method will be run after all the test methods in the current class have been run.
@BeforeMethod: The annotated method will be run before each test method.
@AfterMethod: The annotated method will be run after each test method.
@DataProvider | Marks a method as supplying data for a test method. The annotated method must return an Object[][] where each Object[] can be assigned the parameter list of the test method. The @Test method that wants to receive data from this DataProvider needs to use a dataProvider name equals to the name of this annotatio |
@Parameters | Describes how to pass parameters to a @Test method. |
@Test | Marks a class or a method as part of the test. |
10. Different kind of element locators
https://thenewcircle.com/static/bookshelf/selenium_tutorial/locators.html
11. How you write the test case for search engine, example Google.
12. In UI , if one field is changed to editable to non-editable, how you will test it?
13. What are the web driver methods, which you generally use?
http://selenium-suresh.blogspot.com/2012/09/selenium-web-driver-command-list.htmlhttp://selenium-suresh.blogspot.com/2013/09/selenium-webdriver-methods-with-examples.html
14. Which one is better in finding element css/xpath? When do you use each one?
not only performance is better with CSS locators, it's the compatibility too that matters.
We are testing on a multy browser environment in which we use: IE, SAFARI, FIREFOX, CHROME.
On IE the xpath almost never works OR it is SO slow that it can't be managed. So we use CSS where ever we can. Unfortunately IE does not support many CSS logics like, previous item, next item, counters and so on. But that can be arranged...
You have to tell your Developers to give distinctive IDs To every and each element you are using. It will greatly speed up your performance because you wont be needing to much XPATH magic to reach elements.
15. In complicated web page , how you will find the element , by using xpath or css?
16. If application is working in IE7 and one particular page is working in IE9. So when you navigate to this page it has to work in IE9 and when u navigate to other page it has to come back to ie7 ,
how will you write automation code?
17. Where you will store the test cases?
hp quality center/ALM test mgt tool
hp quality center/ALM test mgt tool
18. How will you run the test cases, did u use any tool?
hp quality center/ALM test mgt tool
hp quality center/ALM test mgt tool
19. Have idea about Jenkins?
20. What you automated in your current application?
21. Difference between interface and abstract?
22. What is constructor?
23. What is public static void main() method?
24. Can you explicitly call other class constructor?
Yes, it is possible:
public class Foo
{
private int x;
public Foo()
{
this(1);
}
public Foo(int x)
{
this.x = x;
}
}
To chain to a particular superclass constructor instead of one in the same class, use
super
instead of this
. Note that you can only chain to one constructor, and it has to be the first statement in your constructor body.
25. Overloading and overriding?
Overloaded Method | Overridden Method | |
---|---|---|
Arguments | Must change | Must not change |
Return type | Can change | Can’t change except for covariant returns |
Exceptions | Can change | Can reduce or eliminate. Must not throw new or broader checked exceptions |
Access | Can change | Must not make more restrictive (can be less restrictive) |
Invocation | Reference type determines which overloaded version is selected. Happens at compile time. | Object type determines which method is selected. Happens at runtime. |
26. Core java(Hashmap vs HashTable).
http://way2java.com/collections/hashtable/hashtable-vs-hashmap/
27. String s = "abbcccdddd" to be encoded to 1a2b3c4d using java program.
28. Program to find if the below pattern matches in given array.
array={10, 23, 1, 45, 5, 6, 2, 7, 8, 9}
array[n1] < array[n2] < array[n3].
29. SQL: function, views, Joins(Theory).
30. Query to get name from table of employee with salary > 1000 (Employee and Salary tables).
31. Two tables given and write test cases to validate the table data.
32. difference between selenium webdriver/rc.
33. what are the common assertions you used in in webdriver.
34. How do you connect to DB in your java code.
35. what are the options for logging your result.
36. what is the object model you used in your framework?
37. what are locators and name few.?
38. how do you identify elements on a webpage..which tool did you use?
39. How do you Sort the numbers using java?
40. write a program to Reverse a string?
41. How do you swap two numbers?
42. Write a program to find factorial or a number using recursion?
43. How will you search for an element ?
44. Find the smallest number from a given array?
45. Perform Read from a file.
46. Perform Write from a file.
47. How will you catch exceptions (write a program with try-catch block)
48. write a program to find common elements between two arrays?
49. describe about your automation framework
50. How do you identify elements in selenium
51. How do you test Ajax application
52. What is the difference between implicit and explicit wait?
Implicit Wait:
1. During Implicit wait if the Web Driver cannot find it immediately because of its availability,
2. The WebDriver will wait for mentioned time and it will not try to find the element again during the specified time period.
3. Once the specified time is over, it will try to search the element once again the last time before throwing exception.
4. The default setting is zero.
5. Once we set a time, the Web Driver waits for the period of the WebDriver object instance.
Explicit Wait:
· Suppose there is a scenario, when a particular element takes more than a minute to load.
· In that case we would definitely not like to set a huge time to implicit wait, as if we do this,
Browser will go to wait for the same time for every element.
Browser will go to wait for the same time for every element.
In order to avoid such situation,
1. Introduce a separate time on the required element only.
2. By following this browser implicit wait time would be short for every element and it would be large for specific element.
Fluent Wait:
Scenario:
Suppose there is an element which takes some time to appear may be in just 1 second & some time it takes minutes to appear.
Suppose there is an element which takes some time to appear may be in just 1 second & some time it takes minutes to appear.
In that case it is better to use fluent wait,
1 .As this will try to find element again and again until it find it or until the final timer runs out.
1 .As this will try to find element again and again until it find it or until the final timer runs out.
53. What is the difference between assert and verify commands?
Verify command will verify the condition and if its not match, it will give error message in Log area and will start executing next commands. while in assert command, if condition does not match then it will stop remaining script execution.
Verify command will verify the condition and if its not match, it will give error message in Log area and will start executing next commands. while in assert command, if condition does not match then it will stop remaining script execution.
54. Write a program in Java to generate Fibonacci Series?
public class fibonacc {
public static void main(String[]args){
int num=8;
int current = 1;
int last = 0;
int lastlast;
for(int i=0;i<num;i++){
lastlast=last;
last=current;
current= last + lastlast;
System.out.println(current);
}}}
55. Write a Program in Java given the following scenario. There will be a log file which will be generated and it will have lot of errors and exception. you need to extract those words which says errors and write it into a file.
58. About my project.
59. Agile Methodology.
60. Selenium Grid/Remote Web Driver.
61. Continuous Integration.
62. Architecture of my frame work.