How To Handle Captcha In Selenium 🤷| Selenium 4 Tutorial With Java | LambdaTest

How To Handle Captcha In Selenium 🤷| Selenium 4 Tutorial With Java | LambdaTest


How To Handle Captcha In Selenium 🤷| Selenium 4 Tutorial With Java | LambdaTest

Captcha has always been tricky for testers to automate since many are unfamiliar with handling Captchas using Selenium. Watch this video to learn how to handle Captcha using Selenium with Java. Start FREE Testing: https://accounts.lambdatest.com/?utm_…

šŸ“¢ In this Selenium 4 Java Tutorial, š‘Øš’š’•š’š’ š‘Øš’š’ˆš’†š’š’š’— (@š’‚š’š’ˆš’†š’š’š’—š’”š’•š’‚š’š’•š’š’), Co-founder \u0026 CTO of Automate The Planet Ltd., explains what is Captcha and how to automate image Captcha in Selenium WebDriver. He also discusses ReCaptcha, which is hosted by Google and protects your site from spam and abuse.

šŸ”¹ š‘¾š’‰š’‚š’• š’Šš’” š‘Ŗš’‚š’‘š’•š’„š’‰š’‚?
āž” CAPTCHA stands for ā€œCompletely Automated Public Turing Test to Tell Computers and Humans Apart.ā€ It is a ā€œchallenge-responseā€ test used to determine if the user is a human or a bot.

šŸ”¹ š‘¾š’‰š’‚š’• š’‚š’“š’† š’•š’‰š’† š’˜š’‚š’šš’” š’•š’ š’‰š’‚š’š’…š’š’† š‘Ŗš’‚š’‘š’•š’„š’‰š’‚ š’Šš’ š‘ŗš’†š’š’†š’š’Šš’–š’Ž?
āž” By disabling Captchas in test environments.
āž” By clicking the reCAPTCHA checkbox in Selenium.
āž” By adding a delay in your Selenium script and manually solving Captcha while running.

šŸ”¹ š‘¾š’‰š’‚š’• š’Šš’” š’“š’†š‘Ŗš‘Øš‘·š‘»š‘Ŗš‘Æš‘Ø?
āž” reCAPTCHA is a CAPTCHA system that lets web hosts tell the difference between real people and automated programs that try to access their sites. Google’s reCAPTCHA is a free service used by many people because it works with most screen readers.

šŸ“ŒAlso, you will learnšŸ“ƒ
šŸ“ Can we handle CAPTCHA in Selenium?
šŸ“ Can we test CAPTCHA and barcode using Selenium?
šŸ“ How do I capture CAPTCHA using automation Anywhere?
šŸ“ Can we automate CAPTCHA using API?

ļ¼¶ÉŖį“…į“‡į“ ļ¼£Źœį“€į“˜į“›į“‡Ź€źœ± šŸ‘€
0:00 Introduction
0:22 Modules
2:30 What is a Captcha?
4:36 Captcha test cases
8:15 Handling Captchas in Selenium with demo
19:57 Handling audio captchas in Selenium with cognitive services
27:50 Conclusion

šŸ“Œ š‘®š’Šš’•š‘Æš’–š’ƒ š‘³š’Šš’š’Œ: https://github.com/AutomateThePlanet/…

š‘¹š’†š’š’‚š’•š’†š’… š‘·š’š’‚š’šš’š’Šš’”š’•š’”
ā–¶ Selenium Testing Tutorial: https://bit.ly/3tblD5a
ā–¶ Selenium 4 New Features and Enhancements | Beginners Guide: https://bit.ly/34JzdDF
ā–¶ JavaScript Selenium Testing Tutorial For Beginners: https://bit.ly/3B00NKw

š‘¹š’†š’š’‚š’•š’†š’… š‘©š’š’š’ˆš’”
āž” How To Handle Captcha In Selenium: https://bit.ly/3fzvRVw
āž” Selenium Java Tutorial: Automation Testing Of User Signup Form: https://bit.ly/3PklUeM
āž” A Detailed Guide On Selenium With Java [Tutorial]: https://bit.ly/3zjOzes
āž” Selenium Automation Testing: Basics and Getting Started: https://bit.ly/3aYJgHQ
āž” Selenium Grid 4 Tutorial For Distributed Testing: https://bit.ly/3Ogo4L3
āž” Complete Selenium WebDriver Tutorial with Examples: https://bit.ly/3GHm0c0
āž” What Is New In Selenium 4 And What Is Deprecated In It?: https://bit.ly/3q8OvsU
āž” How To Build And Execute Selenium Projects: https://bit.ly/3GFLlmS

š‘³š’†š’‚š’“š’š’Šš’š’ˆ š‘Æš’–š’ƒ
🚩 Detailed Selenium 4 Tutorial: https://bit.ly/3mC5m6f
🚩 Selenium Java Tutorial: https://bit.ly/3IOSd3c

Sign Up for LambdaTest! It’s FREE šŸ™Œ
Perform scalable and reliable cross-browser compatibility testing of your website and web app on the latest mobile and desktop browsers: https://accounts.lambdatest.com/?utm_…

Register Now to Avail Bonanza Offerings šŸ’Ž
+ Test websites and web apps on 3000+ real browsers over LambdaTest cloud
+ Trusted By 1M+ users, 500+ enterprises and 130+ countries
+ Online scalable Selenium Grid to perform Manual as well as Automation Testing
+ 100 minutes of free Web + Mobile Automation Testing
+ 60 minutes of free Live Interactive Testing per month
+ 10 Screenshot Tests per month
+ 10 Responsive Tests per month (Test a page across 50+ Device configurations with a single click)
+ Unlimited free testing on LT Browser

For questions: [email protected] 😃

š‘¬š’™š’‘š’š’š’“š’†
šŸŽ¬ Most Recent Videos: https://bit.ly/3kUUeAQ
šŸŽ“ Learning Hub: https://bit.ly/3fr6l4Z
šŸŽ„ LambdaTest Customers: https://bit.ly/2TB7pvD
šŸš€ Webinars: https://bit.ly/37i41co
šŸ› ļø Product Updates: https://bit.ly/3717NGO
šŸ’¬ LambdaTest Certifications: https://bit.ly/3x4EtcY

š‘ŗš’š’„š’Šš’‚š’
šŸ“ BLOG: https://bit.ly/3yGVsUc
šŸ‘„ COMMUNITY: https://bit.ly/3Aiz5oO
šŸ”“ NEWSLETTER: https://bit.ly/3juhxzc
šŸ–¼ļø GITHUB: https://bit.ly/3jowfYs
šŸ› ļø YOUTUBE: https://bit.ly/3rH2Yfh
šŸŒŽ LINKEDIN: https://bit.ly/3xA6F84
šŸ‘„ FACEBOOK: https://bit.ly/37mbQOa
🐦TWITTER: https://bit.ly/3Cn0g3A
šŸ“ø PINTEREST: https://bit.ly/2VCXI05

#selenium4tutorial #javatutorial #captchaautomation #lambdatest #captchaselenium
#seleniumwithjava #selenium4 #selenium4java #seleniumguide #java #selenium

Disclaimer:
This video features materials protected by the Fair Use guidelines of Section 107 of the Copyright Act. All rights reserved to Ā© 2022 LambdaTest. Any illegal reproduction of this content will result in immediate legal action.


Content

4.64 -> hi guys greetings from bulgaria it's in theĀ  middle of summer so here it's really hotĀ Ā 
10.64 -> anyway i'm here for yet another video fromĀ  our selenium course let me share my screen
20.88 -> so i'm antonio and in ourĀ  new course about seleniumĀ Ā 
28.96 -> in the first video we talked about signĀ  up forms uh it's a long video but reallyĀ Ā 
34.48 -> essential especially for junior peopleĀ  because uh sign up forms are stuff thatĀ Ā 
40.56 -> we often ask about tasting such scenarios duringĀ  interviews so check it out it's really important
50.56 -> then as a continuation to that uh in the secondĀ  video it was really interesting we walked intoĀ Ā 
57.68 -> third-party services that can help us to automateĀ  the receiving of emails interacting with them evenĀ Ā 
64.56 -> responsive testing them in the cloud and nowĀ  in the third video we are going to talk aboutĀ Ā 
70.4 -> handling captchas captures we'reĀ  going to talk about what they areĀ Ā 
74.48 -> and uh how to test them and how to interact withĀ  them in our automated tests then we are going toĀ Ā 
81.28 -> talk about cookies in order to speed up ourĀ  test execution and they can help us a lotĀ Ā 
86.72 -> this will happen in the next video and in theĀ  rest of the videos we are going to talk aboutĀ Ā 
93.12 -> how to optimize the speed of your testĀ  with weights in different design patternsĀ Ā 
97.92 -> handling some selenium exceptions and improvingĀ  the maintainability with event listeners if youĀ Ā 
104.72 -> haven't subscribed to the lambdatest video channelĀ  do so hit the ring bell and get notified eachĀ Ā 
113.84 -> week many new videos are uploaded and they areĀ  pretty useful on different technologies and then
124.32 -> yeah check the description below youĀ  will find all the source code that weĀ Ā 
127.92 -> are going to talk about its github andĀ  will add their many useful resourcesĀ Ā 
135.12 -> and of course in each video we are goingĀ  to discuss not only how to make this workĀ Ā 
139.84 -> only on your machine but how to run this inĀ  scale in the cloud because in many enterpriseĀ Ā 
146.8 -> projects actually this is how we execute theĀ  tests in lambda test or another blackboardĀ Ā 
154 -> and now handling captures but before that let'sĀ  first discuss uh what are the captchas and iĀ Ā 
162.16 -> added here a few images uh what is kept captureĀ  stands for wait for it completely ultimate publicĀ Ā 
170.8 -> turing test to tell computers and humans apartĀ  i know it's one this is why we call them captureĀ Ā 
177.12 -> in short and this is basically a type ofĀ  challenge response test used to ascertainĀ Ā 
183.12 -> whether the user is human or a bot theĀ  primary purpose of captcha is to prevent bothĀ Ā 
191.44 -> or automated programs from using various types ofĀ  computing services or collecting certain types ofĀ Ā 
198.08 -> sensitive information such as emails phoneĀ  numbers etc uh there are various formsĀ Ā 
206.64 -> here there are others that are much moreĀ  complicated that you need to do some kindĀ Ā 
211.12 -> of a weird mathematic uh solve mathematic formulaĀ  and then um yeah they're really hard catches rightĀ Ā 
224.16 -> and uh so um to the bottom right you willĀ  see uh uh an image generated by your captureĀ Ā 
233.68 -> and in a minute we're going to talk muchĀ  more about it because this is basicallyĀ Ā 
238.4 -> the capture image capture widgets that it'sĀ  free to use from google and capture are mostlyĀ Ā 
246.88 -> dynamic and are intended to defeat automationĀ  frameworks like selenium however since they areĀ Ā 
253.6 -> dynamic they can be carried out successfully onlyĀ  with or only with human interaction and analysisĀ Ā 
260.96 -> and as a result most of the automation botsĀ  will fail however it's really important sinceĀ Ā 
266.88 -> they are essential parts of our modern webĀ  pages to test them before even automating themĀ Ā 
275.2 -> and what we can test about first you need toĀ  verify that the application accepts only validĀ Ā 
281.52 -> catch right then you need to verify that the codeĀ  uh the captcha code is case sensitive you need toĀ Ā 
291.28 -> verify that the error message is displayedĀ  if a user enters an incorrect captcha codeĀ Ā 
297.92 -> then you need to verify that the captcha code toĀ  the screen is properly visible to the user or notĀ Ā 
304.8 -> then you need to verify that new captchaĀ  is getting generated on batch refresh orĀ Ā 
312.24 -> some captures they have this refresh button youĀ  need to verify that new captcha is generated ifĀ Ā 
319.92 -> a user enters some incorrect captchaĀ  code you need to verify that the copyĀ Ā 
325.36 -> paste action doesn't work on capture inputĀ  boxes this is like a security precaution
332.56 -> and you need to verify that the application isĀ  not accepting partial capture code and from myĀ Ā 
339.12 -> personal experience uh you need to check if yourĀ  website probably is using some kind of a cdn
350.72 -> service for optimizing the speed of websites youĀ  need to check if the images are coming from thereĀ Ā 
357.36 -> that it's working properly or if you are usingĀ  some kind of a service for speed optimizationĀ Ā 
364.56 -> sometimes some of the scripts are merged orĀ  delayed etc so you need to be careful about thatĀ Ā 
371.44 -> because some of these optimizations they areĀ  turned off for the test environments because someĀ Ā 
379.04 -> some of the services they're actuallyĀ  paid many of them based on the worldĀ Ā 
387.52 -> another thing that you need to considerĀ  especially for big websites enterprise websitesĀ Ā 
392.88 -> is that many of them our websites are hosted onĀ  more than one server or the so-called server noteĀ Ā 
401.2 -> and they're behind the world balancer this isĀ  like a service that is balancing the requests uhĀ Ā 
408.56 -> based on the uh the vote on these differentĀ  notes and this means that you're not sure whenĀ Ā 
417.84 -> you send a request on which note you will be uhĀ  balanced right uh usually this is just a singleĀ Ā 
426.32 -> note however in practice it's possible one requestĀ  to go to uh not one and then the second to not twoĀ Ā 
432.72 -> and actually this happens to me uh and we catchĀ  a really weird look uh especially for catchesĀ Ā 
440.64 -> uh also um you need as you can see from from theĀ  right uh there is this audio version that it'sĀ Ā 
448.24 -> like a accessibility feature uh that you needĀ  to check like an alternative to the capture youĀ Ā 
454.96 -> hear something you need to type the textĀ  and then bypass the captcha and actuallyĀ Ā 
460.08 -> as you'll see in the end of the module weĀ  are going to use this option to automateĀ Ā 
464.96 -> some of the pages and of course you need to checkĀ  that this is working on different browser versionsĀ Ā 
471.76 -> operating systems etc or mobile so definitelyĀ  platform such as land this can help here
480.56 -> so what are the what are the different ways toĀ  handle captchas in selenium the easiest and mostĀ Ā 
488.4 -> foolproof way to handle captures in selenium isĀ  to disable the need for captures during your testĀ Ā 
494.24 -> by disabling captures in test environments youĀ  would no longer need uh to perform capturesĀ Ā 
500.88 -> tasks while testing a web application andĀ  actually this was something that we did forĀ Ā 
504.96 -> one of our enterprise projects that my companyĀ  is involved we we talked with developers and theyĀ Ā 
512.8 -> for the test environment they added a specialĀ  cookie that when we add the cookie we're justĀ Ā 
519.36 -> dissembling the captcha this way on the testĀ  environment we we have the full flexibility toĀ Ā 
525.68 -> um turn on the capture test it and then turn itĀ  off for some of the automated tests which is idealĀ Ā 
533.2 -> um however this requires likeĀ  cooperation from the developmentĀ Ā 
538.56 -> this is not always possible and also you needĀ  to be careful with this type of conditions inĀ Ā 
543.84 -> the code because you need to make sure thatĀ  this is not available on production right
552.32 -> because someone might may exploit itĀ Ā 
555.76 -> and the another disadvantage of this approachĀ  is that you are testing something differentĀ Ā 
560.72 -> from your production environmentĀ  ideally you want your automatedĀ Ā 
565.28 -> tests to test your product in an environmentĀ  that resembles your production environment and
574.4 -> now disabling captchas actually has become veryĀ  easy with google's open source capture widgetĀ Ā 
580.24 -> called recaptcha this is uh actually this hereĀ  probably this is version two uh you saw it in manyĀ Ā 
588.08 -> places where you you click at this checkboxĀ  and this is actually a capture version tooĀ Ā 
594.16 -> uh so what is recaptcha capture is a captureĀ  system that enables web host to distinguishĀ Ā 
599.36 -> between human and automated access to websitesĀ  it's a free service from google and it's veryĀ Ā 
605.92 -> widely used nowadays since it supportsĀ  all major browsers and operating systemsĀ Ā 
612.4 -> version 2 you can put a side key and secret keyĀ  also known as test keys in this case will helpĀ Ā 
621.76 -> bypass the capture verification requests as aĀ  result your automation test can run seamlessly
630.72 -> once you enable the site keys you will see aĀ  warning is here as shown below this indicates thatĀ Ā 
638.72 -> the capture has been bypassed only for testingĀ  purposes not in real time uh and let me show youĀ Ā 
647.36 -> here for this demo website that i created thisĀ  is just the contact form uh we are going toĀ Ā 
653.76 -> automate it in a minute uh it just accepts firstĀ  name was name email we have other options hereĀ Ā 
661.44 -> and then in the bottom we have capture version twoĀ  and capture version two it here marks that it'sĀ Ā 
668.64 -> protected by recaptcha this is their website asĀ  i name it capture video here i use version threeĀ Ā 
678.64 -> here i can see my keys you just add them to yourĀ  for wordpress for example there are some pluginsĀ Ā 
684.32 -> that directly you just put the two keys and it'sĀ  added automatically to the contact form or you canĀ Ā 
691.04 -> add it as html snippet it's fine so yeah basicallyĀ  instead of generating here the keys you just putĀ Ā 
701.36 -> the disk is uh actually these are the testĀ  keys here uh from where you can gain themĀ Ā 
708.16 -> because you know um no matter whichĀ  extra widgets you are going to useĀ Ā 
715.28 -> your best friend is actually theirĀ  development documentation you can check it outĀ Ā 
720.64 -> many of these capture services they have a versionĀ  for testing depending on how they are integratedĀ Ā 
728.88 -> whether this is javascript or something elseĀ  and you can turn them off uh and again hereĀ Ā 
736.8 -> on their website they have this iĀ  would like to run automatic testsĀ Ā 
741.12 -> with their capture what should i doĀ  and then you get these two hardcodedĀ Ā 
746.72 -> keys and you put them in your testĀ  environment and then this will workĀ Ā 
752.64 -> this is one of the ways how you can do itĀ  however this is version 2. uh actually they haveĀ Ā 
760.16 -> a capture version 3 which is sometimes referred toĀ  as invisible capture actually it doesn't have thisĀ Ā 
767.28 -> checkbox and uh capture version 3 actually verifyĀ  request with a score it allows you to verifyĀ Ā 
775.6 -> even interaction is legitimate without anyĀ  user interaction it is a pure javascript apiĀ Ā 
782.4 -> returning a score and this gives your developersĀ  the ability to take action in the context of yourĀ Ā 
789.92 -> website for instance requiring additional vectorsĀ  authentication sending a post for moderationĀ Ā 
796.96 -> or throttling bots that may be scrappingĀ  condense how you can handle invisible capture
806.16 -> you know unfortunately the invisible capturesĀ  they try to block the web traffic that appearsĀ Ā 
811.36 -> to come from a bot it detects as you know whenĀ  when we started this in selenium they appearĀ Ā 
817.76 -> here that they are controlled by automatedĀ  test software so this invisible captureĀ Ā 
822.48 -> detects that uh and it will uh basically blockĀ  off the web traffic so one way to handle thatĀ Ā 
830.88 -> is if we set a different user agent theĀ  user agent is used in http to controlĀ Ā 
841.36 -> basically instruct the server from which typeĀ  of web clients we are asking the web resourcesĀ Ā 
850.24 -> so we can change them they are websitesĀ  that you can find many different user agentsĀ Ā 
855.2 -> this is the first thing and then theĀ  second thing is that you need to um
863.28 -> basically uh another way these invisible capturesĀ  uh are detecting that you are not a human if youĀ Ā 
870.88 -> use um not recommended non-conventional viewportsĀ  and this is why another way is just always toĀ Ā 
879.76 -> start maximize the web browser and use properĀ  resolution if you are using a cloud platformĀ Ā 
886.56 -> these are the two ways how youĀ  can battle the invisible captchasĀ Ā 
890.4 -> usually uh in some of the enterpriseĀ  projects that i have been involvedĀ Ā 
895.52 -> we use some kind of a combination betweenĀ  version 2 and version 3 is a fallback
901.92 -> so what we do here uh to automate this captchaĀ  another thing you need to consider when when weĀ Ā 
909.28 -> are dealing with such captures is that uh if youĀ  want to check this box uh we need to make sure toĀ Ā 
919.44 -> check it in a timely manner and simulateĀ  that you are not a bolt you don't want toĀ Ā 
924.48 -> check it too fast otherwise it will detect thatĀ  uh you are not a human so uh one way to do thatĀ Ā 
935.36 -> is we are going to use webdriverweight andĀ  we will wait until this checkbox is clickableĀ Ā 
942.16 -> again in a different module from the course we'reĀ  going to talk about trade slips weightings etcĀ Ā 
948.72 -> anyhow before that we're going to talk about howĀ  we can wait for that another thing if you findĀ Ā 
957.2 -> this div here and if you want to check it you willĀ  notice that this just don't work right for exampleĀ Ā 
966.96 -> here is my test again we find we navigateĀ  to the website uh we find the differentĀ Ā 
973.12 -> elements the first name was last name emailĀ  in the different inputs by id and we type theĀ Ā 
980.16 -> text i use here a library popular java libraryĀ  called faker we use it to generate the test dataĀ Ā 
990.24 -> and also be careful use save email otherwiseĀ  if you just use email address it will generateĀ Ā 
998.24 -> valid yahoo and gmail email addresses and you mayĀ  send an email to someone that you don't want to umĀ Ā 
1008.4 -> so until here we we filled all of the fields rightĀ  and then uh we need to uh click on the captcha
1020.64 -> checkbox and to do that if we scroll as i saidĀ  you you won't be able to and you won't be ableĀ Ā 
1028.4 -> to because actually the checkbox and the wholeĀ  captcha it's inside of iframe and iframe isĀ Ā 
1035.04 -> actually like a webpage inside the web page andĀ  from basic selenium you know that you need toĀ Ā 
1040.56 -> switch first to the iframe and then interact withĀ  it however this iframe here it doesn't have aĀ Ā 
1047.36 -> an id actually it has a random generatedĀ  name just for this purpose howeverĀ Ā 
1052.4 -> it has this title and we can find it by titleĀ  when you press ctrl f we can find it by export
1062 -> if you haven't watched there is aĀ  whole course about junit and seleniumĀ Ā 
1066.16 -> 4. inside the both courses i have videosĀ  where i talked about advanced expatĀ Ā 
1074.56 -> there is a whole view about relativeĀ  locators in selenium 4 and thereĀ Ā 
1079.2 -> i also show many advanced expatĀ  expressions so check this video out so hereĀ Ā 
1086.16 -> we can use uh expo light frame then squareĀ  brackets and again provided with it title equalsĀ Ā 
1100.08 -> and then this recapture title and this isĀ  finding the the iframe and we can wait for itĀ Ā 
1108.4 -> to be available this is another option fromĀ  webdriverweight and when you click it then
1117.28 -> we'll see how it goes after thatĀ  so um as i said first we need toĀ Ā 
1125.68 -> add it here uh we use weight then untilĀ  methods then we have this static classĀ Ā 
1132.96 -> expected conditions were available and switched toĀ  it you don't need after that to switch actually ifĀ Ā 
1140.24 -> you wait for the iframe to be there as i saidĀ  it's loading a little bit slower just to filterĀ Ā 
1148.64 -> some of the balls that are clicking reallyĀ  quick and i provided the expat expression hereĀ Ā 
1155.76 -> then after that as i said uh when we locate theĀ  check box we need to make sure to be uh again theĀ Ā 
1165.44 -> checkbox might be there but it might be still notĀ  available another element is loaded on top of itĀ Ā 
1171.6 -> and uh this you cannot click it right awayĀ  this is why there is another method here calledĀ Ā 
1179.44 -> element to be clickable and this will wait forĀ  our div with this recapture checkbox border classĀ Ā 
1188.16 -> to be clickable and then we'll check it againĀ  probably if you run these tests a few times
1197.92 -> the thing that will happen is thatĀ  this images here will appear andĀ Ā 
1204.96 -> now it's the problem how how you battle that ifĀ  you don't use the hard coded keys that they showedĀ Ā 
1211.44 -> actually there is like weĀ  can utilize a new technology
1218.64 -> it's many of the cloud platforms nowadays noĀ  matter whether it's azure amazon google and othersĀ Ā 
1225.28 -> they offer this speech-to-text cognitive serviceĀ  or ai that basically can hook to your microphoneĀ Ā 
1233.2 -> and when when you use the audio version itĀ  can listen and it will translate the audioĀ Ā 
1239.84 -> into a text then we can get the text and put it inĀ  inside and then let's see what will happen again
1250.08 -> all these things that i'm going to show youĀ  there for testing purposes only only for yourĀ Ā 
1256.96 -> test environments don't try to break realĀ  catches right and also you will have toĀ Ā 
1263.92 -> fine tune the code later however from here iĀ  noticed that it's working perfectly fine so
1274.64 -> leveling technique
1278.96 -> now we can copy and verify it's working like aĀ  chart right um of course we are not going to useĀ Ā 
1288.88 -> their name website actually i registered suchĀ  a service in my azure account again i'm usingĀ Ā 
1294.08 -> azure because in some of the projects mainlyĀ  we use azure but in other projects we useĀ Ā 
1299.6 -> amazon in others google it's completely fine theĀ  pricing is similar the features are similar so
1309.68 -> how you can find it actually they haveĀ  cognitive service speech sdk for java iĀ Ā 
1317.92 -> already installed it in my project here youĀ  just need this additional maven dependencyĀ Ā 
1326.56 -> called microsoft cognitive service speech thenĀ  you need to provide the proper key of courseĀ Ā 
1332.96 -> don't try to use it i mean i alreadyĀ  deleted uh my key but i i tried itĀ Ā 
1341.04 -> so they have like demos here hr samples cognitiveĀ  service pitch sdk and we can search for microphone
1356.32 -> so as you can see here in the first exampleĀ  they have this recognized once a sinkĀ Ā 
1363.76 -> and you will notice that if you use it since theĀ  capture they have this security mechanism forĀ Ā 
1370.96 -> this background noise then some pauses andĀ  because of the pauses actually this willĀ Ā 
1375.84 -> take just the first word of it but basicallyĀ  when you initialize again your subscription keyĀ Ā 
1384 -> in service region you initialize this speechĀ  recognizer object and inside of it you have
1392.56 -> this recognizer you you canĀ  go recognize once a syncĀ Ā 
1397.44 -> let's see they should have anotherĀ  option this is again only onceĀ Ā 
1407.84 -> you can download the code but basically i am goingĀ  to show you they have another version i alreadyĀ Ā 
1415.76 -> downloaded it and work with it so
1421.36 -> let me show you
1426.24 -> so after we again there is another frame uh whenĀ  when you click uh on on here when you click hereĀ Ā 
1437.2 -> there is another iframe that is different fromĀ  the one that we found for capture so againĀ Ā 
1444.72 -> you need to switch to this iframe as well it'sĀ  called recapture challenge expire in two minutesĀ Ā 
1452.32 -> this is what i am doing hereĀ  again with the same methodĀ Ā 
1455.6 -> but first you need to switchĀ  to default then to this
1460.72 -> another capture another iframe thenĀ  i click the recapture audio buttonĀ Ā 
1467.68 -> and after that as i said sometimes if youĀ  directly copy it from the azure examplesĀ Ā 
1475.68 -> it may not work directly for thisĀ  particular captcha it needs some funĀ Ā 
1479.36 -> tuning actually for the websiteĀ  if you try it works every time
1485.68 -> then uh here uh we create the list thatĀ  will put all the different words thatĀ Ā 
1493.12 -> uh the speech organizer uh recognizesĀ  and then here in in these event listenersĀ Ā 
1499.92 -> through lambda i'm initializing anonymousĀ  methods where if we recognize the speechĀ Ā 
1506.4 -> we are going to add it to this recognizedĀ  pitch parts and i'm going to printĀ Ā 
1511.04 -> and then instead of recognizing once i'm usingĀ  this start continuous recognition sync and iĀ Ā 
1518.08 -> will wait for 10 seconds after i click the playĀ  button since this is working in another threadĀ Ā 
1526.56 -> and after that i'm going to click the playĀ  button that's it then i'm closing all of themĀ Ā 
1533.36 -> and the last part is actually where we needĀ  to type we need to type the text here this inĀ Ā 
1544 -> audio response we find the input through stringĀ  join passing the list i'm basically configuringĀ Ā 
1555.36 -> all the parts inside the list in aĀ  single string i'm tapping it we basically
1565.2 -> click the verify button switch to defaultĀ  and click the submit button that's allĀ Ā 
1571.84 -> and it works like a charm as i said iĀ  deleted it just for security purposesĀ Ā 
1580.08 -> um what else uh what's not about this actuallyĀ  there uh there is a really good article aboutĀ Ā 
1588 -> on the london test blog about this how to handleĀ  captures in selenium basically i showed you mostĀ Ā 
1594.32 -> of the stuff um there if you search you will findĀ  that there are some paid services to capture orĀ Ā 
1602.8 -> for example another by capture.com these areĀ  services that they offer different sdks forĀ Ā 
1611.2 -> programming languages where basically they'reĀ  going to break the different types of captures
1620.88 -> and they use actually realĀ  humans to solve the capturesĀ Ā 
1625.28 -> to be honest i wouldn't use themĀ  i'm not sure how legal this is andĀ Ā 
1631.84 -> i don't know from security perspective i don'tĀ  think that this is a good idea as i said myĀ Ā 
1637.2 -> preferred way is just to disable the captures onĀ  test environments and this is just a fun way toĀ Ā 
1643.36 -> see how actually ai can help you uh actually inĀ  the past when um i had a lecture about cuttingĀ Ā 
1650.8 -> edge technologies i used actually visual ai toĀ  solve these small boxes and to recognize themĀ Ā 
1658.56 -> like 50 of the time actually this is workingĀ  so this is another not really expensive optionĀ Ā 
1666.24 -> but yeah i hope that this was usefulĀ  to you um yeah in the next video we areĀ Ā 
1672.24 -> going to talk about handling cookiesĀ  how actually we can use cookies toĀ Ā 
1677.12 -> walk in faster to websites how we can deal withĀ  this really annoying gdpr notifications and yeahĀ Ā 
1688.32 -> it will be really interesting and useful videoĀ  again thank you for watching please comment belowĀ Ā 
1696.88 -> if you like the video or if youĀ  want to see other different videosĀ Ā 
1701.52 -> about selenium and other technologiesĀ  if you have any questions put them belowĀ Ā 
1707.36 -> check them on this blog they are really awesomeĀ  articles there and don't forget to get yourĀ Ā 
1712.88 -> selenium certification or january 10 hours seeĀ  you soon in the next video thank you for watching
1738.8 -> you

Source: https://www.youtube.com/watch?v=CCcGPLaaU10