03. Selenium Interview Questions Part - 3

1.   Please tell me the difference b/w implicitly  Wait and Explicit wait.

Implicit Wait sets internally a timeout that will be used for all consecutive Web Element searches. It will try lookup the element again and again for the specified amount of time before throwing a NoSuchElementException if the element could not have been found. It does only this and can't be forced into anything else - it waits for elements to show up.


Explicit Wait or just Wait is a one-timer used by you for a particular search. It is more extendible in the means that you can set it up to wait for any condition you might like. Usually, you can use some of the prebuilt Expected Conditions to wait for elements to become clickable, visible, invisible, etc., or just write your own condition that suits your needs.

2.   How we can retrieve the dynamically changing Ids? When we login Facebook the login label's id  changes dynamically thus resulting in failure.
We have a hierarchy of locators and Facebook Is dynamic in nature,so we are not able to use "id" for  identification for after that we have remaining 7 locator's for that :2. xpath ().. 3. name..4. css.. 5. link text.. 6. partiallinktext...7.tag name. so u can use any one for   identifying it. Most probably u can use "xpath" or  "css-locator" and if there r tag then  link text or partial-link text. it depend on u . But we never use id's in Ajax application  because it’s not possible.

3.What is the difference between driver.Close()  and driver.Quit () method?
Close() - It is used to close the browser or page currently which is having the focus.
Quit() - It is used to shut down the web driver instance or destroy the web driver instance
(Close all the windows)

4.   How to scroll web element?--not browser—
FirefoxProfile profile=new FirefoxProfile();
profile.setEnableNativeEvents(true);
WebDriver driver=new FirefoxDriver(profile);
driver.navigate("http://jqueryui.com/draggable/");
Thread.sleep(6000L);
WebElement element=driver.findElement(By.xpath("//div[@id='draggable']"));
Actions actn=new Actions(driver);
actn.dragAndDropBy(element, 50, 50).build().perform();
}

5.   What is the basic use of Firefox profiles and how can we use them using selenium?
A profile in Firefox is a collection of bookmarks, browser settings, extensions, passwords, and history; in short, all of your personal settings.
We use them to change user agent, changing default download directory, changing versions etc.

6.   Customize the name of file going to be  downloaded?
You have to download AUTO IT.exe file and has to be install and later you have create .au3 file (in this file you have to specify the commands in  VB script  like your file  name, where have to save, it will be easy may be 3 or 4 steps ) using AUTOIT...then right click the .au3 file you have to compile ....after that you will get the .exe file with the name of .au3 file ..In eclipse you will give the code like this
<----ProcessBuildder ps = new ProcessBuilder("path of the .exe file of au3") .start();--->


7.   How to handle internationalisation through  web driver?
FirefoxProfile profile = new FirefoxProfile();
profile.set Preference("intl.accept_languages","jp");
Web driver driver = new FirefoxDriver(profile); driver.get(google.com) will open google in
Japanese Lang

8.   How to overcome same origin policy through web driver?
·         Proxy server.
DesiredCapabilities capability=new DesiredCapabilities.firefox();
capability.setCapability(CapabilityType.PROXY,"your desire proxy")
WebDriver driver=new FirefoxDriver(capability);

9. How to put text in Facebook search box using selenium web driver.
·         driver.findElement(By.xpath("//div[contains(@class, '_586i')]")).sendKeys("abc");

10. Difference between flex and flash application.
In flash there is no code just based on creativity(design) we will complete the work(time consuming process) whereas flex contain some small functions  which is integrated with mxml,PHP..(no tool is there to develop  flex we want to use the properties of css and style sheet)


5 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