5. org.openqa.selenium.WebDriverException: unknown
error: unhandled inspector error: {"code":-32000,
"message":"Cannot navigate to invalid URL"}
(Session info: chrome=60.0.3112.113)
(Driver info: chromedriver=2.32.498550
(9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platfo
rm=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The
server did not provide any stacktrace
information)
Command duration or timeout: 0 milliseconds
...
7. What will selenide do?
A: Open google.com B: Wait four seconds
C: NullPointerException D: WebDriverException
selenide.open("google.com");
8. Exception in thread "main"
org.openqa.selenium.WebDriverException: unknown error: unhandled
inspector error: {"code":-32000,"message":"Cannot navigate to
invalid URL"}
(Session info: chrome=61.0.3163.91)
(Driver info: chromedriver=2.32.498513
(2c63aa53b2c658de596ed550eb5267ec5967b351),platform=Linux 4.10.0-
35-generic x86_64) (WARNING: The server did not provide any
stacktrace information)
Command duration or timeout: 14 milliseconds
Build info: version: '3.4.0', revision: 'unknown', time:
'unknown'
System info: host: 'sergey-asus', ip: '127.0.1.1', os.name:
'Linux', os.arch: 'amd64', os.version: '4.10.0-35-generic',
java.version: '1.8.0_144'
Driver info: org.openqa.selenium.chrome.ChromeDriver
selenide.url: http://localhost:8080google.com
9. What will happen?
A: Set value to 1 B: NoSuchOptionException
C: NullPointerException D: InvalidElementStateException
<select id=”listBox”>
<option value=’2’>1</option>
</select>
$("#listBox").setValue("1");
10. Exception in thread "main"
org.openqa.selenium.InvalidElementStateException: invalid element
state: Element must be user-editable in order to clear it.
(Session info: chrome=60.0.3112.113)
(Driver info: chromedriver=2.32.498537
(cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platform=Mac OS X
10.12.6 x86_64) (WARNING: The server did not provide any
stacktrace information)
Command duration or timeout: 8 milliseconds
11. What will be printed in console?
B: Element page lost
C: Nothing D: WrongLocatorException
try{
$("element").waitUntil(appear, 3000);}
catch(NoSuchElementException ex){
Assert.fail("Element page lost");}
A: NoSuchElementException
12. Exception in thread "main" Element not found {#bad}
Expected: visible
Screenshot:
file:/home/sergey/Github/demo/build/reports/tests/1505985705319.0
.png
Timeout: 3.500 s.
Caused by: NoSuchElementException: no such element: Unable to
locate element: {"method":"css selector","selector":"#bad"}
try{
$(“element”).waitUntil(appear, 3000);
}catch(UIAssertionError ex){
Assert.fail(“Element page lost”);
}
15. Which text you got?
A: “Text with spaces” B: “Text with spaces”
C: Depends on browser D: “h1”
<h1>
Text with spaces
</h1>
findElement(By.tagName("h1")).getText();
19. Which exception will be thrown?
B: None
C: NoSuchElement D: Both
A: Timeout
driver.manage().timeouts()
.implicitlyWait(10,TimeUnit.SECONDS);
wait = new WebDriverWait(driver,5);
wait.until(ExpectedConditions
.presenceOfElementLocated(locator));
21. Which is faster?
A: By.id B:By.Xpath
C: They are equal D: By.css
driver.findElement(By.id("someId"));
driver.findElement(By.cssSelector("#someId"));
23. How long will we wait here?
A: 7 B: 12
C: 4 D: 3
driver.manage()
.timeouts().implicitlyWait(3,SECONDS);
$("wrongId");
driver.findElement(By.id("wrongId"));
24. What will happen?
A: Test will pass B: Assert fail
C:NullPointerException D: NoSuchElement
class Page{ WebElement header; }
driver.get(“http://google.com”);
Page p = initElements(driver,Page.class);
Assert(p.header.text() == “Google”);
25. INFO: Detected dialect: OSSException in thread
"main"
org.openqa.selenium.NoSuchElementException: no
such element: Unable to locate element:
{"method":"name","selector":"header"} (Session
info: chrome=60.0.3112.113) (Driver info:
chromedriver=2.32.498537
(cb2f855cbc7b82e20387eaf9a43f6b99b6105061),platf
orm=Mac OS X 10.12.6 x86_64)
...
26. What will happen?
A: HateJSException B: WebDriverException
C: Print Text D: Object
console.log($('div').getText());