Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a) Java
b) Perl
c) VBScript
d) Python
c) Open Source
d) No IDE
a) goToUrl("url")
b) navigate.to("url")
c) getUrl("url")
d) get("url")
4. Which of the following is the correct ‘Webdriver’ command to “delete all cookies in the browser”?
a) Driver.deleteAllCookies()
b) Driver.manage().deleteCookies()
c) Driver.manage().deleteAllCookies()
d) Driver.deleteCookies()
5. In webdriver, which of the following is a valid select statement that selects a value from a dropdown
element?
b) selectByIndex()
c) selectByValue()
d) selectByVisibleText()
a) True
b) False
7. In webdriver, which of the following commands retrieves the text of html element?
a) selectText()
b) getText()
c) getElementText()
d) getText(WebElement)
8. In webdriver, which command takes you forward by one page on the browser’s history?
a) navigate.forward()
b) Navigate.forward()
c) navigate ().forward ()
d) Navigate.forward
e) navigate_forward()
wait.until(ExpectedConditions.presenceOfElementLocated(by));
a) True
b) False
10. Which of the following Selenium API enables running Selenium 1.0 tests in web driver?
a) Selenium RC
b) None of the listed options
c) Webdriver
d) WebDriverBackedSelenium
11. In WebDriver, which command can be used to enter values onto text boxes? Select the best answer.
a) type()
b) selenium.type()
c) driver.type("text")
d) sendKeys()
e) sendKeys("text")
12. Which command should be used to ensure Selenium applies wait time for all UI elements in the
script?
a) Explicit wait
b) Fluent Wait
c) Implicit Wait
d) Sleep
13. Which of the following is the correct option to close all the opened browser sessions at one step?
a) Driver.close()
b) Driver.quit()
c) Driver.closeAll()
d) Driver.exit()
a) Element.toggle()
b) Element.click()
c) Element.set()
d) Element.select()
15. Which of the following will terminate the test when the check fails
a) Verify
b) Assert
a).switchto().window(Integer)
b).switchto().window(string)
c).switchto().window(Array)
d) .switchto().window(array list)
17. Which command to be used to get the text from Alert message popup
a) //*[@class=’submit’]
b) //div[contain(@class,’submit’)]
c) //div[@class=’submit’]
d) //div[contains(@class,’submit’)]
19. Implicit wait time is applied to all elements in your script and Explicit wait time is applied only for
particular specified element.
a) True
b) False
20. In webdriver, which method closes the open browser?
a) quit()
b) terminate()
c) shutdown()
d) close()
driver.findElement(By.cssSelector(“#name”));
a) Output is Name 1
b) Output is Name 2
a) ID
b) Name
c) Password
d) Link Text
23. In web driver, what is the method that counts the number of elements?
a) driver.getCountOfElements()
b) driver.findElement(By.id("search")).getCount()
c) driver.findElements(By.i("search")).size()
d) driver.findElements(By.id("search")).length()
c) Once set, the implicit wait is set for the life of the WebDriver object instance.
d) An implicit wait is the code you define to wait for a certain condition to occur before proceeding
further in the code.
25. Identify the steps to instantiate the Chrome driver in correct sequence
a) 1. Using System Property set method get the path of chrome driver
b) 1. Using System Property set method get the path of chrome driver
c) 1. Using System Property set method get the path of chrome driver
3. Using System Property set method get the path of chrome driver
26. Identify the valid command to handle pop ups in chrome browser
b) driver.findElement(By.id(‘AlertId’)).sendkeys(Keys.Enter);
a) http://localhost:portno
b.http://localhost:portno/grid/console
c.https://localhost:portno/grid/console
28. Select the variation which locates elements by the value of the “name” attribute in Web driver
Selenium
a) By.name
b) By.nametag
c) By.tagname
d) By.nametags
29. Select the Get command which fetches the inner text of the element that you specify in Web driver
Selenium.
a) getinnerText()
b) get_in_Text()
c) get_inner_Text()
d) getText()
• Firefox
• Google Chrome
• Internet Explorer
• Opera
• Safari
a) css = li.contains("Opera")
b) css = ul.li(4)
c) css = ul > li:nth-of-type(4)
e) css = ul.li:nth-child(4)
System.out.println(driver.getTitle());
System.out.println(driver.findElement(By.tagName(“title”)).getText())
a) True
b) False
32. To run a test on Firefox browser, you must have which of the following?
33. Identify the correct code snippet to double click an element using selenium from the following:
a) WebElement el = driver.findElement(By.id(“Element”));
Builder.doubleClick().build().perform()
b) WebElement el = driver.findElement(by.id(“ElementID”))
Buider.doubleClick().build()
c) WebElement el = driver.findElemet(by.id(“ElementID”))
Buider.doubleClick().build()
d) WebElement el = driver.findElement(By.id(“ElementID”)
Builder.doubleClick(el).build()perform()
34. Which of the following is the correct Webdriver statement to retrieve the row count of a Table?
b) Driver.FindElements(By.Xpath(“//table[@id=’tableID’]/tr”)).size();
c) Driver.FindElements(By.Xpath(“//table[@id=’tableID’]/tr”)).getrowcount();
d) Driver.FindElements(By.Xpath(“//table[@id=’tableID’]/tr”)).getcount();
35. Which of the following features are applicable for both Test NG and Junit?
I) Suite Test
Select One:
a) I, II, III IV
b) I and II
c) I
d) I and III
c) It is used to execute multiple test cases on multiple Systems with different browser with Different
version and Different Operating System.
Example:
.pollingEvery(5, SECONDS)
.ignoring(NoSuchElementException.class);
1. Ignores NoSuchElementException
b) Option 3 & 4
a) Webdriver
b) TestNG
c) Junit
d) Selenium GRID
js.executeScript("arguments[0].click();", element);
c) JavascriptExecutor js = (JavascriptExecutor)driver;
js.executeScript("arguments[0].click();", element);
40. Identify Invalid Syntax for refreshing the browser
a) driver.findElement(By.id("firstname-placeholder")).sendKeys(Keys.F5);
b) driver.refresh();
c) driver.get(driver.getCurrentUrl());
d) driver.findElement(By.id("firstname-placeholder")).sendKeys("\uE035");
1 2
3 4
driver.findElement(By.xpath(“//table/tr[1]/td”)).getText();
42. Which method is used when you want to verify whether a certain check box, radio button, or option
in a drop-down box is selected in Web driver Selenium
a) is_Selected()
b) isSelect()
c) isSelected()
d) is_Select()
a) By DOM query
b) BY XPath query
c) BY CSS sector
d) All of these
45. To delete a cookie we need to call the deleteCookie method, passing in two parameters.
a) The first parameter is the name of the cookie, and the second parameter is where it was created.
b) The first parameter is where it was created, and the second parameter is the name of cookie.
c) None of these
46. Selects all the parent, grandparent, and so on of the element is related to which axis name in
Selenium:
a) Ancestor
b) Preceding
c) Parent
d) All of these.
47. You have to use ‘Xpath’ to locate the following input element:
b) //input[@id=’fk-top-search-box’]
c) //input[starts-with(@class, ”search-bar-text”)]
a) click_Context()
b) context.Click()
c) contextClick()
d) context_Click()
b) This is comment
d) All of these
50. Which of the following API enables running Selenium 1.0 tests in Webdriver
a) Webdriver
c) WebdriverbackedSelenium
d) Selenium RC
Extras 1
3. Under which setting absolute path of chrome driver is set -- Option: browser setting
8. Which core logic of test case is directly embedded with corresponding script ?
9. In which approach test can be executed multiple set of test data ? data driven framework
11. What routes selance request from test in selenium grid? – option: selenium hub
1. where do you verify the test execution results for the test scenario named "test demo"--- results
testdemo
2. in CRAFT/CRAFTLite the default special character to refer the common data from any test data sheet
is--- *
5. under which settings the absolute path of the chrome driver is set--- browser setting
6. CRAFT.file framework best suits when your project is completely owned by automation team which is
well versed with the automation tool and scripting language--- true
8. which is used to test at scale for large test suites that must be run in multiple environment---
selenium grid
9. which of the following method is used to set the type of browser and operating system that we will
automate---- desired capabilities
10. when does the hub give the following message. A client waiting in queue has given up once it was
offered a new session---- ORPHAN
13. selenium grid suites that specializes in running multiple tests across in parallel--- all 1, 2, 3
15. in webdriver which command takes u forward by one page in the browser history--
navigate().forward()
16. in webdriver which of the following command retrieves the text of an html element---
gettext(webelement)
i. identifier
ii. Id
iii. Name
iv. Link
v. DOM
vi. XPath
vii. CSS
viii. UI-element
20. @BeforeGroups
The list of groups that this configuration method will run before. This method is guaranteed to run
shortly before the first test method that belongs to any of these groups is invoked.
21. @BeforeClass
The annotated method will be run only once before the first test method in the current class is invoked.
22. @AfterMethod
23. @AfterClass
The annotated method will be run only once after all the test methods in the current class have run.
Extras 2
1. When the core logic of the test cases is directly embedded within the cross ponding test
scripts. Then, it is called
a) Data driven Approach
b) Hybrid driven Approach
c) Keyword driven Approach
d) Modular driven Approach
2. CRAFT Lite test scripts are organised in
Select one
a) Start, Execute Test, Stop
b) In*****, Execute Test, Break
c) Setup, Execute Test, Break
d) Setup, Execute Test, Tear Down
3. Which function is used to output Intermediate data (Output values) into the specified
data sheet?
a) dataTable.put()….
b) dataTable.getExpec…..()
c) dataTable.getData()
d) dataTable.Setup(Data)
4. Under which setting The absolute path of then chrome drive is set
a) General setting
b) Browser setting
c) Privacy setting
d) Execution setting
5. which is used to test at scale for large test suites that must be run in multiple environment
a) Selenium AC
b) Selenium grid
c) Selenium MG
d) Selenium Web Driver
6. We can use Selenium grid for performance testing
State True or False
a) True
b) False
7. By default, what is the combination of browser testing the node, allowed for ****
users?
a) 3 Firefox, 5 Chrome, 3 Internet Explorer
b) 4 Firefox, 4 Chrome, 3 Internet Explorer
c) 5 Firefox, 5 Chrome, 1 Internet Explorer
d) 5 Firefox, 3 Chrome, 3 Internet Explorer
8. Where does the hub give the following message: The session has been *** because the
node has ***** on the grid
a) Proxy registration
b) Time Out
c) Client_Stopped_Session
d) Browser_TimeOut
10. Testing framework allows us to generate test reports in both html and xml—true
11. which language is not supported by selenium
Many languages are supported including C#, Java, Perl, PHP, Python and Ruby
Ans :- Javascript
assertEquals
assertNotEquals
assertTrue
assertFalse
assertNull
assertNotNull
(* Above are the assertions in selenium web driver. In question there will be 3 assertions from
the list. So, the answer will be 1,2,3)
13. In TestNG allows user to set dependencies _ True
14. we can priorities for test using TestNG _ True
15. Which of the following is supported tool by Craft/CraftLite tools
a. MS VSTS
b. watir
c. Renorex
d. TestCafe
(Please find the answer)
16 . TsetNg doesnot require main method() to execute :- False
Selenium basics:
Ans: b.
Ans: b.
Ans: driver.quit()
Ans: c.
Ans: a.
Ans: d.
Firefox Driver is capable of being run and is tested on Windows, Mac, Linux.
Ans: b.
Ans: a.
Ans: b
Ans: c
Ans: a.
------
Ans: a & b.
Ans: implicit
Ans: c
Ans: a)
Ans: d.
Ans: b.
Ans: c
Ans: a
Ans: b and d
Ans: a.
Ans: b.
Ans: d.
Ans: d.