Selenium Mostly Asked Interview Questions
Q1. How to configure RC in eclipse
Download jar files from internet and include in eclipse projects.
Added inside project under eclipse.
Q2. What is Java Doc?
Documentation of selenium is known as java doc, it is downloaded with Jar files.
Go to javadoc folder and click on index.html.
Q3 what is default selenium class?
It has all the functions which are present in selenium interface its webdriver.
Q4. What is difference between throw and throws exception.
Throw:- we deliberately throws the exception
Throws :- we give the exception when same exception used many times
Q5. Finally block means?
Block which will always run
Q6. What is final keyword?
Final is a variable whose value cannot be changed.
Q7. How to store the entire link on a page using arrays? It may be dynamic.
There is a collection API which in build class called array list, it help in storing dynamic increasing data structure.
Syntax :- arraylist<datatype> <object name> = new arraylist<data type>()
In selenium we can use when we have object in bulk.
Array list class do not have any final size.
Q8. Hash Table?
It is also dynamically growing data structure, it’s an inbuilt class
Hashtable <string,string> table = new hashtable <string,string> ()
It always has a key value pair
Eg:-
Table.put(“Key”,”Value)
There is no index there is a key and it should be unique.
One key can have only one value:-
Table.put(“name”,”Aj”)
Now
System.out.println(table.get(“Name”));
It will print Aj, hash table do not have index it will have key value.
In selenium it is used to store test data.
* So collection API has array and hash table.
Q9. How to create a array list inside a array list and hash table inside a hash table?
Hastable<string,string> table1 = new hashtable <string,string>
Table1.put(“City1”,”ja”)
Table1.put(“City2”,”fa”)
Table1.put(“City3”,”ma”)
Hastable<string,string> table2 = new hashtable <string,string>
Table2.put(“City1”,”3021”)
Table2.put(“City2”,”3221”)
Table2.put(“City3”,”3023”)
Make them part of one table
Hastable <string,hashtable<string,string> > table = new hashtable <string,hashtable<string,string> >
Table.put(“name”,table1)
Table.put(“zip”,table2)
System.out.println(table.get(“name”).get(“city2”));
It will put:- fa
Q10. What is reflection API?
It is used to create hybrid frame work; it helps in calling the function whose name is same as the name of variable
String x = “Simplt text”;
Now it will be done by:-
Method method = ReflectionAPI.class.getmethod(x, String.class);
Method.invoke(method, “hellow”);
Method is a inbuilt class in reflection API
And we have a function
Public static void samplttest (string x) {
System.out.println (“In sample test—“ +x);
Now above Reflection API.class.getmethod(x, String.class);
x will have value = “sample text” and get method will call the method getmethod sametext and String.class means method accept the value sting.
Method.invoke(method, “hallow”); here same text will be called and hallow is printed.
So we can change the value of X and can call any function in it.
good work
ReplyDeletethanks.. If you have any query please post we all can find the solution.
DeleteRegards,
testwithus
Unbilivable work... I was looking such stuff from long time.. Thnks a lot..
ReplyDeletethanks.. If you have any query please post we all can find the solution.
DeleteRegards,
testwithus
Very good Article on Selenium Web Driver Basics. Found few interesting commands which can be used to add spice to automation work.
ReplyDeleteBTW could you please add some more information on parametrization in Web driver using Excel??
Sure I will try
DeleteYou can use POI Api for it, it is explained in one of the page.
DeleteVery Very Thanks to all who have done this great job....
ReplyDeleteWe really want this stuff
Thanks Once again...
Thanks...... good stuff.......
ReplyDeletenice work..looking forward to see more of web driver stuff..keep posting advanced concepts such that those beginner's can also understand with ease
ReplyDeletethanks again
Software testing training in Jaipur www.qaguides.com
ReplyDeleteSelenium training in jaipur www.qaguides.com
software testing course in jaipur www.qaguides.com
software testing training institute in jaipur www.qaguides.com
selenium training in jaipur www.qaguides.com
DevOps training in Jaipur www.qaguides.com
Devops classes in Jaipur www.qaguides.com
Python training in Jaipur www.qaguides.com
python coaching in jaipur www.qaguides.com
python course in jaipur www.qaguides.com
python classes in jaipur www.qaguides.com
best python training in jaipur www.qaguides.com
python institute in jaipur www.qaguides.com
best python coaching in jaipur www.qaguides.com
best java training institute in jaipur www.qaguides.com
java training institute in jaipur www,qaguides.com
java classes in jaipur www.qaguides.com
Java training in Jaipur www.qaguides.com
Summer Internship Training Jaipur www.qaguides.com
Summer Training In Jaipur www.qaguides.com
MCA Internship in Jaipur www.qaguides.com
Internship in Jaipur www.qaguides.com
Jmeter Training in jaipur www.qaguides.com
Salesforce Training in jaipur www.qaguides.com
Salesforce classes in jaipur www.qaguides.com
Appium Training in jaipur www.qaguides.com
Appium classes in jaipur www.qaguides.com
Software testing training in Jaipur www.qaguides.com
ReplyDeleteSelenium training in jaipur www.qaguides.com
software testing course in jaipur www.qaguides.com
software testing training institute in jaipur www.qaguides.com
selenium training in jaipur www.qaguides.com
DevOps training in Jaipur www.qaguides.com
Devops classes in Jaipur www.qaguides.com
Python training in Jaipur www.qaguides.com
python coaching in jaipur www.qaguides.com
python course in jaipur www.qaguides.com
python classes in jaipur www.qaguides.com
best python training in jaipur www.qaguides.com
python institute in jaipur www.qaguides.com
best python coaching in jaipur www.qaguides.com
best java training institute in jaipur www.qaguides.com
java training institute in jaipur www,qaguides.com
java classes in jaipur www.qaguides.com
Java training in Jaipur www.qaguides.com
Summer Internship Training Jaipur www.qaguides.com
Summer Training In Jaipur www.qaguides.com
MCA Internship in Jaipur www.qaguides.com
Internship in Jaipur www.qaguides.com
Jmeter Training in jaipur www.qaguides.com
Salesforce Training in jaipur www.qaguides.com
Salesforce classes in jaipur www.qaguides.com
Appium Training in jaipur www.qaguides.com
Appium classes in jaipur www.qaguides.com
www.qaguides.com