04. Selenium Interview Questions Part - 4

1. How to get text from captcha image??
driver.findElement(By.xpath(".//*[@id='SkipCaptcha']")).click();
String attr = ie.findElement(By.xpath(".//*[@id='SkipCaptcha']")).getAttribute("value");
System.out.println("The value of the attribute 'Name' is " + attr);

2. Is there a way to click hidden LINK in web driver?
String Block1 = driver.findElement(By.id("element ID"));
JavascriptExecutor js1=(JavascriptExecutor)driver;
js1.executeScript("$("+Block1+").css({'display':'block'});");

3. What Class Extends Web Driver?
·   AndroidDriver, ChromeDriver, EventFiringWebDriver, FirefoxDriver, HtmlUnitDriver,
InternetExplorerDriver, IPhoneDriver, PhantomJSDriver, RemoteWebDriver, SafariDriver
4. What are the APIs that support Web Driver?
·         API are  nothing but collection of all selenium commands for Locating UI Elements
(WebElements),Fetching a Page,User Input  etc…

5. How to disable cookies in browser.
·         Using deleteAllVisibleCookies() in selenium

6. How to change user agent in Firefox by selenium  web driver.
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("general.useragent.override", "some UA string");
Web Driver driver = new FirefoxDriver(profile);

7. What is Selenese?
Selenese is HTML language based command, which is used in Selenium IDE.

8. Differences between QTP and selenium.
1) Selenium generates a proxy while starting browser. QTP does not
2) QTP uses only Vb script. Selenium is available in many languages
3) QTP is paid and selenium is free.
4) You can run script from a particular line in QTP but in selenium, you cannot.
5) Selenium works on all browsers. QTP only works on IE, mozilla. Support from chrome has been introduced lately.
6) QTP is more organized and user friendly
7) Selenium requires more technical skills
8) QTP can also be used on desktop based applications but selenium cannot be used

9. What is the MOST challenging test problem in my career in Automation?
In my career
·         Changing XPATHS' between testing server and production server-by keeping generic xpath
·         Keep separate property files for production and UAT
·         automating flash apps
·         Mobile Automation

10. “Suppose developer changed the existing image to new image with same xpath. Is test case pass or fail?" ·         Pass

11. How to handle network latency using selenium? 
·         Using driver.manage.pageLoadingtime for network latency

12. How does u handle dynamic elements without using  xpath (with example?)
·         By using classname or css.

13. What are the different types of driver implementation?
·         AndroidDriver, AndroidWebDriver, ChromeDriver, EventFiringWebDriver, FirefoxDriver, HtmlUnitDriver, InternetExplorerDriver, IPhoneDriver, IPhoneSimulatorDriver, RemoteWebDriver, SafariDriver, WebDriverBackedSelenium

14. Code for Opening Firefox browser?
·         Webdriver driver=new FireFoxdriver();

15. Which repository you have used to store the test  scripts?

I have created scripts in excel file and store them in Test cases folder under src .

2 comments:

  1. Very Nice...Contains A to Z concepts...Thanks a lot.. and looking for the best selenium training in Chennai with certification from us. we have experienced selenium experts offer selenium course training with industry exposure. Check Here https://goo.gl/VRNEXv

    ReplyDelete
  2. Selenium is one of the most popular automated testing tool used to automate various types of applications. Selenium is a package of several testing tools designed in a way for to support and encourage automation testing of functional aspects of web-based applications and a wide range of browsers and platforms and for the same reason, it is referred to as a Suite.
    Selenium Interview Questions and Answers

    ReplyDelete