Translate

Selenium RC

1) What do you know about selenium RC (Remote Control)?
A)  Selenium RC starts up browsers(one at a time) and then runs commands we pass along from our tests..  It allows us to use a programming language for maximum flexibility and extensibility in developing test logic.. It provides an API and library for each of its supports languages like Java, Ruby, Python, Perl and C#..
-->Selenium RC has 2 components.. Selenium server and Client libraries.. Selenium Server launches and kills browser.. Client libraries provide the interface between each programming language and the Selenium RC server..
2) Briefly explain how Selenium RC executes your scripts ?
A)  Client libraries communicate with the Server passing each selenium command for execution.. Then the server passes the selenium command to the browser using Selenium-Core Java Script commands.. The browser, using its JavaScript interpreter, executes the selenium commands.. This runs the Selenese actions or verifications you specified in your test script..
3) What are the requirements needed to run simple script in RC ?
A)  A browser, command prompt, Selenium Server jar file are enough to run simple scripts in RC..
Selenium Server is needed inorder to run selenium RC scripts..
4) How to set up selenium RC completely with eclipse to run junit tests ?
A)    First we need to download Selenium Server jar file, Selenium client libraries, junit jar file, eclipse and java software.. There after, open eclipse and click on workbench and then create a java project with meaningful name... Set path to java and jar files... Drag and drop your test scripts(which are exported from IDE) to the package you have created in the project.. Before running any test you must start the server..
5) Why selenium RC is used ?
A)   Selenium RC is used to automate web applications with more effective browser actions when compared to SIDE(Selenium IDE).. As selenium RC uses a programming language, we can overcome limitations of SIDE i.e we can handle multiple windows and pop-ups, we can use loops and conditions, capturing screenshot etc.. In addition to that, RC can perform Data-Driven(read/write data from external files) concept, decent report generation and mailing that report to concern person etc.. 
6) What are the languages and operating systems that support RC ?
A)   RC supports languages like Java, C#, Perl, Ruby, Python and PHP.. Operating systems like Windows, Mac OS X, Linux, Solaris etc..
7) What are the advantages and disadvantages of RC ?
A)  advantages:
  • Selenium RC can be used for any java script enabled browser..
  • Support for many operating systems and Programming languages..
  • We can use loops and conditions for better performance and flexibility..
  • Decent report generation..
  • Can handle Dynamic objects and Ajax based UI elements..
  • Can read/write data from/to .txt, .xls, etc..
disadvantages:
  •  There are very limited features in RC when working with Ajax based UI elements..
  • Cannot handle on-load alerts..
  • Controlling multiple windows is somewhat difficult..
8) In Selenium what are the four parameters you have to pass?
A)    Host, port number, browser and URL...
9) Can we handle pop-ups in RC ?
A)    Yes, we can handle pop-ups in RC... Using selectWindow method, pop-up window will be selected and windowFocus method will let the control from current window to pop-up window and perform some actions according to our script..

10) Which method will you use for mouse left click and right click ?
A)    For mouse left click i use 'click' method and for right click i use 'keyDown' method followed by 'click' and 'keyUp' methods i.e 'keyDown' method will press 'control' key without releasing it yet and then click method will be executed, after that 'keyUp' method will release the 'control' key..... Code will be as follows..
          left click      --->  selenium.click(locator)
          right click  --->  selenium.keyDown(locator,keysequence)
selenium.click(locator)
selenium.keyUp(locator,keysequence)
NOTE : Here, all the three locators belong to same element/object and keysequence will be ASCII value for 'control' key...
11) What is the use of 'chooseOkOnNextConfirmation()' ?
A)    This command is used to select/click 'OK' button in the confirmation box and it must be placed before the occurrence of confirmation box...  
12) What is a framework and what are the frameworks available in RC ?
A)    Framework is nothing but a structure that allows us to do things better and faster... It is a collection of libraries and classes and they are very helpful if testers want to automate test cases.. JUnit, NUnit, TestNG, Bromine, RSpec, unittest are some of the frameworks available in RC ..
13) How do you handle secured connection error in HTTPS ?
A)    Create an object to 'RemoteControlConfiguration' class, set 'TrustAllCertificate' flag to true and then pass remotecontrolcofiguration instance to SeleniumServer. i.e.
RemoteControlConfiguration r= new RemoteControlConfiguration();
r.setTrustAllCertificate(true);
SeleniumServer s=new SeleniumServer(r);
14) If the default port of selenium is busy then which port you will use ?
A)    We can use any port number which is valid.. First create an object to remote control configuration. Use 'setPort' method and provide valid port number(4545,5555,5655, etc).. There after attach this remote control configuration object to selenium server..i.e
RemoteControlConfiguration r= new RemoteControlConfiguration();
r.setPort(4567);
SeleniumServer s= new SeleniumServer(r);
15) How do you select second value from a drop down menu ?
A)   Define an array of string type.. By using 'getSelectOptions' command provide locator for that particular drop down and then use 'select' command.. As 'select' command parameters are locator and the label, in-place of label, define array index... i.e,.
String a[]=selenium.getSelectOptions(locator of drop down);
selenium.select("locator of drop down", a[1]);
note: If you want to select 5th value from drop down, then provide '4' in the index of an array because array index starts from 'zero'...
16) What is the difference between sleep() and setSpeed() methods ?
A)    Both will delay the speed of execution... When you use Thread.sleep(), then the execution of your test will be stopped until the time you have provided in sleep method, it will wait only once where the command is used where as using setSpeed() method we can set the time of delay which will follow each and every selenium command i.e if you set 5000 milliseconds then your test execution will wait 5 seconds after each and every selenium operation

30 comments:

shri said...

good one

Unknown said...

very helpful

Unknown said...

very helpful

Anonymous said...

Thank you so much....

Anonymous said...

Really Helpful and Thanks Madam/...

Anonymous said...

Very Nice and helpful.
Also because one does not need to become a member of the site.

Thanks..

Unknown said...

Thanks so much it was very much useful can u pls explain something abt keyword driven framework in selenium using a simple example

Anonymous said...

Thank you....very useful

Anonymous said...

thanks so lot Sirji,
when will you update Selenium webdriver IQ

Upasanasrecipes said...

Very nice n helpful post.Please add Selenium Web driver interview questions n answers also.

KODALI ASHOK CHOWDARY said...

Thank u so much for these one....really its helpfull....

ruchi said...

for more selenium interview questions ans answers.
please visit-http://www.studyselenium.com/2013/12/100-selenium-interview-questions.html

Unknown said...

it'nice one....

Anonymous said...

its really helpful....Nice work

Anonymous said...

its really helpful....Nice work

Anonymous said...

really very nice article.

seeker said...

Thank you so much.your valuable time given to us.

seeker said...

Thank you so much.your valuable time given to us.

Unknown said...

Selenium IDE is the older version of selenium. Selenium Workshop in Velachery which will let you how automation testing can be done using selenium and it will be very much helpful during the interview session.

JAHAN said...

Hi admin this is very informative blogs i like this blog very much. Thanks for sharing this blog. keep sharing this kind of valuable information. i waiting for our next blog.


selenium Training in chennai

Unknown said...

Very nice n helpful post.Please add Selenium Web driver interview questions n answers also.


Selenium Training in Bangalore

Melba henry said...

Great Post!! Thanks for your post!! Check out some of the best selenium concepts which can help you as well. Software Testing Training in Chennai | Selenium Training in Chennai

svrtechnologies said...


It is really helpful! An opportunity to read a fantastic and imaginary blog. It gives me lots of pleasure and interest.
sap abap online training

gowthunan said...

Your blog provided us useful information to work on. You have done an outstanding job.
industrial safety course in chennai

ritika.blogspot.com said...

Sap fico training institute in Noida

Sap fico training institute in Noida - Webtrackker Technology is IT Company which is providing the web designing, development, mobile application, and sap installation, digital marketing service in Noida, India and out of India. Webtrackker is also providing the sap fico training in Noida with working trainers.


WEBTRACKKER TECHNOLOGY (P) LTD.
C - 67, sector- 63, Noida, India.
F -1 Sector 3 (Near Sector 16 metro station) Noida, India.

+91 - 8802820025
0120-433-0760
0120-4204716
EMAIL: info@webtrackker.com
Website: www.webtrackker.com

Jaweed Khan said...

Thanks For Sharing the Information The Information Shared Is very valuable Please Keep Updating us Time Just Went On Reading The article Python Online Training Hadoop Online Training Data Science Online Training AWS Online Training

Prwatech said...

I Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the big data training in bangalore Providers who helped me a lot to achieve my dreams comes true. Really worth trying Freelance seo expert in bangalore

Faizal said...

Excellent blog with lots of information. I have to thank for this...Gained lots of Tips and Hints from it, Keep Updating...
Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

jeni said...

Thanks for a marvelous posting! I seriously enjoyed reading it, you are
a great author.I will be sure to bookmark your blog and will often come back in the future.
I want to encourage yourself to continue your great job, have a
nice weekend!

oracle training in chennai

oracle training in velachery

oracle dba training in chennai

oracle dba training in velachery

ccna training in chennai

ccna training in velachery

seo training in chennai

seo training in velachery

Peter Johnson said...

Excellent blog with lots of information. I have to thank for this...I want to share about Signova Group