Delivered by FeedBurner

Selenium Questions Part - 8

Part 8

36 : When I am running software web application's tests In Firefox Browser using selenium webdriver, It Is not showing me any bookmarks, addons, saved passwords etc. In that browser. Do you know why?
Answer : Yes. It Is because all those bookmarks, addons, passwords etc.. are saved In your regular browser's profile folder so when you launch browser manually, It will use existing profile settings so
It will show you all those stuffs. But when you run your software web application's tests In selenium webdriver, It Is opening new browser Instance with blank/new profile. So It will not show you bookmarks and all those things In that browser Instance.

You can create custom firefox profile and then you can use It In selenium webdriver test. In your custom profile, you can set all required bookmarks, addons etc.. VIEW THIS EXAMPLE to know how to set custom profile of firefox browser.

37 : Arrange bellow given drivers In fastest to slowest sequence?
Firefox Driver, HtmlUnit Driver, Internet Explorer Driver.
Answer : HTMLUnit Driver Is faster than all other drivers because It Is not using any UI to execute test cases of software web application. Internet Explorer driver Is slower than Firefox and HtmlUnit driver. So, Fastest to slowest driver sequence Is as bellow.
  1. HtmlUnit Driver
  2. Firefox Driver
  3. Internet Explorer Driver
38 : What Is Ajax?
Answer : Asynchronous JavaScript and XML Is full form of AJAX which Is used for creating dynamic web pages very fast for software web applications. Using ajax, We can update page behind the scene by exchanging small amounts of data with server asynchronously. That means, Using ajax we can update page data Without reloading page.

39 : How to handle Ajax In selenium WebDriver?
Answer : Generally we are using Implicit wait In selenium WebDriver software automation tests to wait for some element to be present on page. But Ajax call can not be handled using only Implicit wait In your test because page not get reloaded when ajax call sent and received from server and we can not assume how much time It will take to receive ajax call from server.

To handle ajax call In selenium WebDriver software automation tests, We needs to use webdriver's FluentWait method or Explicit Waits which can wait for specific amount of time with specific condition. You can get different Explicit Waits examples links on THIS PAGE.

40 : On Google search page, I wants to search for some words without clicking on Google Search button. Is It possible In WebDriver? How?
Answer : Yes we can do It using WebDriver sendKeys method where we do not need to use Google Search button. Syntax Is as bellow.
driver.findElement(By.xpath("//input[@id='gbqfq']")).sendKeys("Search Syntax",Keys.ENTER);

In above syntax, //input[@id='gbqfq'] Is xPath of Google search text field. First It will enter "Search Syntax" text In text box and then It will press Enter key on same text box to search for words on Google.

No comments:

Post a Comment