Automation puzzlers

Yaroslav Pernerovsky
Yaroslav PernerovskyTest Automation Lead at GlobalLogic
Test Automation
Puzzlers
WAT?
Ciklum
https://www.facebook.com/yaroslav.pernerovsky
Sergey
Pirogov
Yaroslav
Pernerovsky
https://www.facebook.com/spirogov
GlobalLogic
driver.get("google.com");
What will selenium do?
A: Open google.com B: Sent GET request
C: NullPointerException D: WebDriverException
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
...
People says that Selenide is better
What will selenide do?
A: Open google.com B: Wait four seconds
C: NullPointerException D: WebDriverException
selenide.open("google.com");
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
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");
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
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
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”);
}
Automation puzzlers
Automation puzzlers
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();
element.getAttribute("textContent");
driver.manage().timeouts()
.implicitlyWait(10,TimeUnit.SECONDS);
wait = new WebDriverWait(driver,5);
wait.until(ExpectedConditions
.presenceOfElementLocated(locator));
How long will Selenium wait?
A: 5 B: 15
C: 10 D: 0
Implicit Wait hereExplicit Wait here
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));
Automation puzzlers
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"));
static id(id) {
return By.css('*[id="'+ escapeCss(id) +'"]');
}
public WebElement findElement(SearchContext context) {
if (context instanceof FindsById)
return ((FindsById) context).findElementById(id);
return ((FindsByXPath)context)
.findElementByXPath(".//*[@id = '" + id + "']");
}
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"));
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”);
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)
...
What will happen?
A: HateJSException B: WebDriverException
C: Print Text D: Object
console.log($('div').getText());
$(‘div’).getText()
.then(function(text) { console.log(text); })
Thank you!
https://www.facebook.com/yaroslav.pernerovskyhttps://www.facebook.com/spirogov
1 of 28

Recommended

WebDriver Waits by
WebDriver WaitsWebDriver Waits
WebDriver WaitsYaroslav Pernerovsky
1.9K views55 slides
Implicit and Explicit waits in Selenium WebDriwer, how to. by
Implicit and Explicit waits in Selenium WebDriwer, how to.Implicit and Explicit waits in Selenium WebDriwer, how to.
Implicit and Explicit waits in Selenium WebDriwer, how to.Yaroslav Pernerovsky
1.8K views33 slides
Yaroslav Pernerovsky - You are doing it wrong all the time by
Yaroslav Pernerovsky - You are doing it wrong all the timeYaroslav Pernerovsky - You are doing it wrong all the time
Yaroslav Pernerovsky - You are doing it wrong all the timeIevgenii Katsan
67 views33 slides
Experienced Selenium Interview questions by
Experienced Selenium Interview questionsExperienced Selenium Interview questions
Experienced Selenium Interview questionsarchana singh
179 views12 slides
Forcetree.com writing a java program to connect to sfdc by
Forcetree.com writing  a java program to connect  to sfdcForcetree.com writing  a java program to connect  to sfdc
Forcetree.com writing a java program to connect to sfdcEdwin Vijay R
8.1K views28 slides
Python: the coolest is yet to come by
Python: the coolest is yet to comePython: the coolest is yet to come
Python: the coolest is yet to comePablo Enfedaque
1.2K views70 slides

More Related Content

What's hot

Cross Domain Web
Mashups with JQuery and Google App Engine by
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
3.7K views60 slides
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic by
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum
467 views12 slides
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019 by
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019Matt Raible
191 views65 slides
Metrics-Driven Engineering at Etsy by
Metrics-Driven Engineering at EtsyMetrics-Driven Engineering at Etsy
Metrics-Driven Engineering at EtsyMike Brittain
10.6K views46 slides
To Err Is Human by
To Err Is HumanTo Err Is Human
To Err Is HumanAlex Liu
4K views130 slides
The Screenplay Pattern: Better Interactions for Better Automation by
The Screenplay Pattern: Better Interactions for Better AutomationThe Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better AutomationApplitools
2.7K views109 slides

What's hot(20)

Cross Domain Web
Mashups with JQuery and Google App Engine by Andy McKay
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
Andy McKay3.7K views
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic by Infinum
Infinum Android Talks #16 - Retrofit 2 by Kristijan JurkovicInfinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum Android Talks #16 - Retrofit 2 by Kristijan Jurkovic
Infinum467 views
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019 by Matt Raible
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Morocco 2019
Matt Raible191 views
Metrics-Driven Engineering at Etsy by Mike Brittain
Metrics-Driven Engineering at EtsyMetrics-Driven Engineering at Etsy
Metrics-Driven Engineering at Etsy
Mike Brittain10.6K views
To Err Is Human by Alex Liu
To Err Is HumanTo Err Is Human
To Err Is Human
Alex Liu4K views
The Screenplay Pattern: Better Interactions for Better Automation by Applitools
The Screenplay Pattern: Better Interactions for Better AutomationThe Screenplay Pattern: Better Interactions for Better Automation
The Screenplay Pattern: Better Interactions for Better Automation
Applitools2.7K views
Coolblue - Behind the Scenes Continuous Integration & Deployment by Matthew Hodgkins
Coolblue - Behind the Scenes Continuous Integration & DeploymentCoolblue - Behind the Scenes Continuous Integration & Deployment
Coolblue - Behind the Scenes Continuous Integration & Deployment
Matthew Hodgkins1.2K views
Scraping recalcitrant web sites with Python & Selenium by Roger Barnes
Scraping recalcitrant web sites with Python & SeleniumScraping recalcitrant web sites with Python & Selenium
Scraping recalcitrant web sites with Python & Selenium
Roger Barnes9.1K views
Multi Client Development with Spring - Josh Long by jaxconf
Multi Client Development with Spring - Josh Long Multi Client Development with Spring - Josh Long
Multi Client Development with Spring - Josh Long
jaxconf2.5K views
Learning Java 4 – Swing, SQL, and Security API by caswenson
Learning Java 4 – Swing, SQL, and Security APILearning Java 4 – Swing, SQL, and Security API
Learning Java 4 – Swing, SQL, and Security API
caswenson1.7K views
Callbacks, promises, generators - asynchronous javascript by Łukasz Kużyński
Callbacks, promises, generators - asynchronous javascriptCallbacks, promises, generators - asynchronous javascript
Callbacks, promises, generators - asynchronous javascript
Łukasz Kużyński17.1K views
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019 by Matt Raible
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 201910 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
10 Excellent Ways to Secure Your Spring Boot Application - Devoxx Belgium 2019
Matt Raible473 views
Selenium Sandwich Part 1: Data driven Selenium by Workhorse Computing
Selenium Sandwich Part 1: Data driven Selenium Selenium Sandwich Part 1: Data driven Selenium
Selenium Sandwich Part 1: Data driven Selenium
Introduction to AngularJS by Pat Cito
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Pat Cito2.7K views
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会 by Miki Takata
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
2011/1/27 Amazon Route53 使ってみた@第1回クラウド女子会
Miki Takata4.1K views
The Promised Land (in Angular) by Domenic Denicola
The Promised Land (in Angular)The Promised Land (in Angular)
The Promised Land (in Angular)
Domenic Denicola23.1K views

Viewers also liked

QA Club Kiev #19 - ISTQB to be or not to be by
QA Club Kiev #19 - ISTQB to be or not to beQA Club Kiev #19 - ISTQB to be or not to be
QA Club Kiev #19 - ISTQB to be or not to beQA Club Kiev
2.4K views49 slides
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты? by
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?QAFest
548 views45 slides
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестирования by
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестированияQA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестирования
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестированияQAFest
856 views35 slides
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradox by
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradoxQA Fest 2017. Mark Winteringham. The automated acceptance testing paradox
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradoxQAFest
581 views20 slides
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибались by
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибалисьQA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибались
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибалисьQAFest
520 views13 slides
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac... by
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...QAFest
1.2K views36 slides

Viewers also liked(6)

QA Club Kiev #19 - ISTQB to be or not to be by QA Club Kiev
QA Club Kiev #19 - ISTQB to be or not to beQA Club Kiev #19 - ISTQB to be or not to be
QA Club Kiev #19 - ISTQB to be or not to be
QA Club Kiev2.4K views
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты? by QAFest
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?
QA Fest 2017. Игорь Хрол. Кто должен писать автоматические тесты?
QAFest548 views
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестирования by QAFest
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестированияQA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестирования
QA Fest 2017. Иван Пашко. Антипаттерны и запахи в автоматизации тестирования
QAFest856 views
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradox by QAFest
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradoxQA Fest 2017. Mark Winteringham. The automated acceptance testing paradox
QA Fest 2017. Mark Winteringham. The automated acceptance testing paradox
QAFest581 views
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибались by QAFest
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибалисьQA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибались
QA Fest 2017. Денис Жевнер. Вы думали ваши секреты в безопасности? Вы ошибались
QAFest520 views
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac... by QAFest
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...
QA Fest 2017. Никита Галкин. Контрактное тестирование на примерах или Contrac...
QAFest1.2K views

Similar to Automation puzzlers

huhu by
huhuhuhu
huhuDung Trương
540 views60 slides
State of the resource timing api by
State of the resource timing apiState of the resource timing api
State of the resource timing apiAaron Peters
4.7K views21 slides
KISS Automation.py by
KISS Automation.pyKISS Automation.py
KISS Automation.pyIakiv Kramarenko
449 views68 slides
Spicy javascript: Create your first Chrome extension for web analytics QA by
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QAAlban Gérôme
352 views44 slides
Updates since :has() was enabled in Chrome by
Updates since :has() was enabled in ChromeUpdates since :has() was enabled in Chrome
Updates since :has() was enabled in ChromeIgalia
14 views23 slides
Chromium Embedded Framework + Go at Brooklyn JS by
Chromium Embedded Framework + Go at Brooklyn JSChromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JSquirkey
634 views31 slides

Similar to Automation puzzlers(20)

State of the resource timing api by Aaron Peters
State of the resource timing apiState of the resource timing api
State of the resource timing api
Aaron Peters4.7K views
Spicy javascript: Create your first Chrome extension for web analytics QA by Alban Gérôme
Spicy javascript: Create your first Chrome extension for web analytics QASpicy javascript: Create your first Chrome extension for web analytics QA
Spicy javascript: Create your first Chrome extension for web analytics QA
Alban Gérôme352 views
Updates since :has() was enabled in Chrome by Igalia
Updates since :has() was enabled in ChromeUpdates since :has() was enabled in Chrome
Updates since :has() was enabled in Chrome
Igalia14 views
Chromium Embedded Framework + Go at Brooklyn JS by quirkey
Chromium Embedded Framework + Go at Brooklyn JSChromium Embedded Framework + Go at Brooklyn JS
Chromium Embedded Framework + Go at Brooklyn JS
quirkey634 views
Testing at Both Ends of the Triangle by Derek Graham
Testing at Both Ends of the TriangleTesting at Both Ends of the Triangle
Testing at Both Ends of the Triangle
Derek Graham41 views
Going Offline with Gears And GWT by tom.peck
Going Offline with Gears And GWTGoing Offline with Gears And GWT
Going Offline with Gears And GWT
tom.peck3.7K views
Detecting headless browsers by Sergey Shekyan
Detecting headless browsersDetecting headless browsers
Detecting headless browsers
Sergey Shekyan25.9K views
Web UI test automation instruments by Artem Nagornyi
Web UI test automation instrumentsWeb UI test automation instruments
Web UI test automation instruments
Artem Nagornyi10K views
Naive application development by Shaka Huang
Naive application developmentNaive application development
Naive application development
Shaka Huang1.2K views
Testing ASP.NET - Progressive.NET by Ben Hall
Testing ASP.NET - Progressive.NETTesting ASP.NET - Progressive.NET
Testing ASP.NET - Progressive.NET
Ben Hall5K views
Frameworkless Web Development in Clojure by Kungi2342
Frameworkless Web Development in ClojureFrameworkless Web Development in Clojure
Frameworkless Web Development in Clojure
Kungi23421.3K views
The Big Picture and How to Get Started by guest1af57e
The Big Picture and How to Get StartedThe Big Picture and How to Get Started
The Big Picture and How to Get Started
guest1af57e1.6K views
Drive chrome(headless) with puppeteer by VodqaBLR
Drive chrome(headless) with puppeteerDrive chrome(headless) with puppeteer
Drive chrome(headless) with puppeteer
VodqaBLR1.9K views
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020 by Matt Raible
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
Matt Raible177 views
High Performance Snippets by Steve Souders
High Performance SnippetsHigh Performance Snippets
High Performance Snippets
Steve Souders5.9K views
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts by Simo Ahava
MeasureCamp IX (London) - 10 JavaScript Concepts for web analystsMeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
MeasureCamp IX (London) - 10 JavaScript Concepts for web analysts
Simo Ahava5K views

Recently uploaded

Introduction to Git Source Control by
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source ControlJohn Valentino
6 views18 slides
Using Qt under LGPL-3.0 by
Using Qt under LGPL-3.0Using Qt under LGPL-3.0
Using Qt under LGPL-3.0Burkhard Stubert
13 views11 slides
SAP FOR CONTRACT MANUFACTURING.pdf by
SAP FOR CONTRACT MANUFACTURING.pdfSAP FOR CONTRACT MANUFACTURING.pdf
SAP FOR CONTRACT MANUFACTURING.pdfVirendra Rai, PMP
13 views2 slides
Agile 101 by
Agile 101Agile 101
Agile 101John Valentino
9 views20 slides
Understanding HTML terminology by
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminologyartembondar5
6 views8 slides
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...Marc Müller
41 views62 slides

Recently uploaded(20)

Introduction to Git Source Control by John Valentino
Introduction to Git Source ControlIntroduction to Git Source Control
Introduction to Git Source Control
John Valentino6 views
Understanding HTML terminology by artembondar5
Understanding HTML terminologyUnderstanding HTML terminology
Understanding HTML terminology
artembondar56 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller41 views
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI... by Marc Müller
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Dev-Cloud Conference 2023 - Continuous Deployment Showdown: Traditionelles CI...
Marc Müller42 views
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P... by NimaTorabi2
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
Unlocking the Power of AI in Product Management - A Comprehensive Guide for P...
NimaTorabi215 views
Copilot Prompting Toolkit_All Resources.pdf by Riccardo Zamana
Copilot Prompting Toolkit_All Resources.pdfCopilot Prompting Toolkit_All Resources.pdf
Copilot Prompting Toolkit_All Resources.pdf
Riccardo Zamana16 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta7 views
Quality Engineer: A Day in the Life by John Valentino
Quality Engineer: A Day in the LifeQuality Engineer: A Day in the Life
Quality Engineer: A Day in the Life
John Valentino7 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski12 views
Top-5-production-devconMunich-2023.pptx by Tier1 app
Top-5-production-devconMunich-2023.pptxTop-5-production-devconMunich-2023.pptx
Top-5-production-devconMunich-2023.pptx
Tier1 app8 views
360 graden fabriek by info33492
360 graden fabriek360 graden fabriek
360 graden fabriek
info33492143 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views

Automation puzzlers

  • 4. driver.get("google.com"); What will selenium do? A: Open google.com B: Sent GET request C: NullPointerException D: WebDriverException
  • 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 ...
  • 6. People says that Selenide is better
  • 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();
  • 17. driver.manage().timeouts() .implicitlyWait(10,TimeUnit.SECONDS); wait = new WebDriverWait(driver,5); wait.until(ExpectedConditions .presenceOfElementLocated(locator)); How long will Selenium wait? A: 5 B: 15 C: 10 D: 0
  • 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"));
  • 22. static id(id) { return By.css('*[id="'+ escapeCss(id) +'"]'); } public WebElement findElement(SearchContext context) { if (context instanceof FindsById) return ((FindsById) context).findElementById(id); return ((FindsByXPath)context) .findElementByXPath(".//*[@id = '" + id + "']"); }
  • 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());