Got Some objective type questions in an exam of selenium
1. How many nodes can be connected to a hub?
d. As many as you want
2. Which one is correct for priority in TestNG?
a. Priority is considered at entire suite level.
b. Priority is not considered if tests are run in parallel.
c. Priority is considered at the test name or class name something level only.
d. All of the above
3. What will be the output if following code is executed?
Actions action=new actions(Webdriver);
WebElement we=driver.findElement.By.xpath(“some xpath”);
a. Mouse hover on the element
b. It will change the position of the element
c. It will move to another element – don’t remember exactly
d. It will fix the position of the element – something like this
4. Which one or ONES are the correct methods for drag and drop?
Actions act =new Actions(WebDriver);
WebElement src=driver.findElement.By.xpath(“some xpath”);
WebElement dest=driver.findElement.By.xpath(“some xpath”);
d. one more, I guess all of the above , don’t remember
5. Which one or ONES are the most suitable way to delete cookies?
d. one more don’t remember
6. Which one or ONES are correct for getWindowHandles
a. It will get all the windows which are currently opened,
b. It can have duplicate values
c. It cannot have duplicate values
d. Something – don’t remember
7. Which one or ONES are correct for following code:
a. It will return the alert which is currently opened
b. It will move to another alert – don’t remember
8. What will be the output of following code:
Value = 5/0 or value = /
Catch exception e)
c. It will give runtime error
d. Compilation error
9. Below is the html code
Which one or ONES is the correct xpath for this
10. Which wait is at the driver level?
a. Implicit wait only
b. Explicit wait
11. What will the outcome of this code
Something Wait (-10, SECONDS)
a. It will wait for 10 second.
b. Script will execute for the asynchronous items – something
c. Script will execute for the synchronous items – something
12. Which one is correct to find if the element is visible and clickable?
13. How can we find hidden elements in selenium
a. It cannot be found
14. What is the default time for Waitfor() command in java?
15. When will the exception occur for following:
AssertTitle(Expected title, Actual title);
a. If Expected title does not match with actual title.
b. If Expected title matches with actual title.
c. If expected title is not null and actual is null.
d. If actual title is not null and expected is null.