I'm five minutes in and I can already tell your videos are a freaking god-send. Plus your accent makes listening and comprehending as easy as it should be in your native tongue...even for this American ;)
@LambdaTest2 жыл бұрын
Glad you like them!
@timothylee89022 жыл бұрын
Thank you so much, this tutorial was amazing. Every single concept broken down into small bite size parts to make it really easy to understand. Keep it up please!
@LambdaTest2 жыл бұрын
Glad it helped!
@luizassis2261 Жыл бұрын
Hey Ryan, I'm from Brazil, this course is amazing. Step by step everything explained and instructive, congratulations bro! Please keep creating content like this.
@LambdaTest Жыл бұрын
Thanks Luiz! Subscribe, and look forward to more such tutorials! ✨
@odyseeus71172 жыл бұрын
This is the best selenium tutorial on youtube! 👏👏👏 I hope it hits the number of views and likes it truly deserves.
@LambdaTest2 жыл бұрын
Wow, thank you!
@JoolieEm Жыл бұрын
Hello Ryan, this is a great tutorial on testing in the Mocha framework. Thank you so much for your hard work 🙏💗 I've been learning JavaScript for just a few months and this tutorial is VERY clear and understandable to follow. Great job 👍
@LambdaTest Жыл бұрын
Hey Justyna, Glad you liked it! 😊 Make sure you subscribe to our KZfaq Channel for more such tutorials!
@KyreonGames2 жыл бұрын
Loved this tutorial, everything is well explained and you helped me understand some concepts and the reason behaind them. Keep bringing this kind of content!
@LambdaTest2 жыл бұрын
Great to hear!
@mikaelfilo5257 Жыл бұрын
Very helpful, professional and understandable video tutorial. I learned a lot in less than 3 hours and definitely I highly recommend.
@LambdaTest Жыл бұрын
Glad it helped! Make sure to subscribe to our KZfaq Channel for more such tutorials! 😊
@mauriciohenaorua12272 жыл бұрын
this tutorial is astounding in my opinion, thanks for this marvelous course I was needing for some projects I need to automatize
@LambdaTest2 жыл бұрын
Hey Mauricio, Thanks for watching the video and glad that it was helpful!
@aparnausa36192 ай бұрын
i have read the comments and i am going to start watching right from today
@LambdaTest2 ай бұрын
Great !! All the best
@nikitanovikov70042 жыл бұрын
Best tutorial i've ever seen on Selenium. Thank you so much! I only wish i could like this video second time!
@LambdaTest Жыл бұрын
Glad you liked this!
@joke62155 ай бұрын
Not only I can learn how to write tests, but also how to solve errors like ReferenceError: describe is not defined, No test files found: "test" or [ERR_REQUIRE_ESM], by using stackoverflow. Yes, I'm aware that these problems are not caused by You, it's just a part of experience. 10/10, it's the best tutorial on the YT Edit: And now I see that I just needed to watch another 10 minutes to find a solutions to my other problems, 11/10 tbh.
@LambdaTest5 ай бұрын
We are glad that you found this tutorial helpful ❤ Keep up the great work, and thank you for the feedback. Your journey and progress are inspiring. If you have any more questions or need further assistance, feel free to ask. Happy testing!
@swapniltiwari48994 ай бұрын
How did you fix it? I am struggling to fix the issue
@joke62154 ай бұрын
@@swapniltiwari4899 If you are using newest versions of JS, mocha, ect., don't use chai, that's for sure, and there was something to do with config files, I don't really remember what, but googling error codes eventually solved my problems
@joke62154 ай бұрын
@@swapniltiwari4899 Honestly I don't remember now, but I'm sure that if you are using latest versions of software, you have to exclude chai from code, other problems can be solved by googling errors (took me like 1h or so).
@pabloperalta19944 ай бұрын
@@swapniltiwari4899 i fixed it by changing in the package.json that says the version of chai to 4.2.0 instead of 5, and then run again an npm install. This downgraded the version of chai to one that supports require.
@user-zz4jj2qd6h Жыл бұрын
A good tutorial to get me going in the right direction. I had to add "await driver.manage().setTimeouts({implicit: 3000});" after the url call as it was too quick and not finding the elements
@LambdaTest Жыл бұрын
Thanks Ben ⚡️
@darlansantoscarvalho66192 ай бұрын
What a fantastic job, mate. Here from Brazil and that´s the best tutorial, just love
@LambdaTest2 ай бұрын
Glad you liked it! Please subscribe the channel for more such videos🙂
@CassianoCMDO2 жыл бұрын
Thanks to Lambda Test for all this content, and thank you, Ryan, for share this with us.
@LambdaTest2 жыл бұрын
Our pleasure!
@raimondev68472 жыл бұрын
Congratulations from Spain. A great tutorial, direct and easy. Thank you for this kind of videos for sharing your knowledge. You have a new subscriber!
@LambdaTest2 жыл бұрын
Thanks Raimondev!
@jeffersonpalencia89012 жыл бұрын
Thanks a lot man for the tutorial, really, you make this so simple to understand that is easy to use directly into the code .
@LambdaTest2 жыл бұрын
Glad it helped!
@Alldeveloper235610 ай бұрын
I learned a whole lot. I like how you teach (step by step), very clear. Keep publishing great classes. Thank you!
@LambdaTest10 ай бұрын
Thank you for your kind words! We're delighted to hear that you found the teaching style clear and informative. Please subscribe to our channel and stay tuned for more great content, and happy learning!
@abigailmariano Жыл бұрын
This is very helpful for beginners like me. As a token of appreciation, I didn't skip the ads :) Thank you very much Sir Ryan Howard and the team!
@LambdaTest Жыл бұрын
Glad it was helpful! 😊 Please look forward to more such videos!
@AhmedKhaled-wr8vn Жыл бұрын
Hi Ryan ! This a very helpful Tutorial , appreciate your great job . Thank you so much for your hard work.👍
@LambdaTest Жыл бұрын
Thanks Ahmed 👋🏻, Glad you liked it ✨
@jhonysfernandovallejoaceve2418 Жыл бұрын
these videos were really useful, thanks a lot.
@LambdaTest Жыл бұрын
Thanks Jhonys. Glad you liked it 💖
@ninosbrothermichael18427 ай бұрын
Helped me get started. Thanks a bunch!
@LambdaTest7 ай бұрын
Glad you liked it! Subscribe to our channel for more such videos.
@gelotilaon40112 жыл бұрын
Thank you! Big help!
@LambdaTest2 жыл бұрын
Glad it was helpful!
@TMalaland15 ай бұрын
For recent video viewer (up to 2024) change the require to import to avoid issues
@LambdaTest4 ай бұрын
Hey there, The error message you're encountering, "mvn : The term 'mvn' is not recognized as the name of a cmdlet, function, script file, or operable program.", indicates that Maven is either not installed on your system or its installation path is not added to your system's PATH environment variable. Maven is a build automation tool used primarily for Java projects, and it's required for compiling and running tests with Appium for many Java-based projects. First, you should check if Maven is indeed installed on your system. Open a new command prompt or terminal and type: mvn -version If Maven is not installed, you will need to install it. Here are the general steps for installing Maven: - Download Maven: Go to the official Apache Maven download page and download the latest version. - Extract the Archive: Extract the downloaded archive to a folder on your computer, e.g., C:\Program Files\Apache\maven. Set Up Environment Variables: M2_HOME (Optional on newer versions): Add a new system variable named M2_HOME that points to your Maven folder, e.g., C:\Program Files\Apache\maven. JAVA_HOME: Ensure you have the JAVA_HOME environment variable set to the path of your JDK installation. PATH: Add Maven’s bin directory to the system’s PATH variable, e.g., C:\Program Files\Apache\maven\bin. This allows you to run Maven from the command line anywhere.
@gasghsdsssa73592 жыл бұрын
You helped me a lot. Thank you,
@LambdaTest2 жыл бұрын
Glad to hear that!
@8anA2 жыл бұрын
Great video learnt a ton from it!!! You have an editing error right at the hour mark where you didn't cut out the failed takes. Again, loved the vid.
@LambdaTest2 жыл бұрын
Glad you liked it! and thanks for highlighting the editing error :)
@ksiel998 ай бұрын
Thanks bro, This tutorial help me very much!
@LambdaTest8 ай бұрын
Glad you liked it! Please subscribe to our KZfaq channel for more such videos 🌟
@marto877 Жыл бұрын
amazing work, very clear and instructive👏🏻 highly recomended 🙌🏻
@LambdaTest Жыл бұрын
Thank you Martin, Glad it was helpful 👋🏻
@worldhistory3000bce Жыл бұрын
Cheers mate, that helped a lot
@LambdaTest Жыл бұрын
Glad it was helpful!
@zahidullahsherzad59576 ай бұрын
Thank you so much for your invaluable tutorial! With your guidance, I've successfully developed real-world benchmarking for both WebAssembly (Wasm) and JavaScript (JS). Now, I'm eager to automate these benchmarks to facilitate comparisons between the two technologies. I'm particularly interested in leveraging the Lambda Test report for printing all the benchmark reports. Could you please advise if it's feasible to integrate and display all the reports in the Lambda Test report? like to print the performance and memory taken by both technologies.
@LambdaTest6 ай бұрын
Hey there, You have the flexibility to tailor the widgets on the analytics dashboard to fit your specific needs. Additionally, by utilizing the analytics API, you can create a personalized dashboard. For further details, please visit www.lambdatest.com/blog/lambdatest-analytics/
@niharshiplu11 ай бұрын
Great contest. One interesting observation, how come sequential tests execution (19 sec) is taking lesser time than parallel tests execution (23 sec) using Mocha? Skip the video till 1:21:03 and see for yourself which is a bit confusing!
@LambdaTest11 ай бұрын
When working with a smaller test suite, the benefits of parallel execution might be outweighed by the overhead introduced. As you correctly pointed out: Setup/Teardown Overhead: Each parallel test might require its own environment setup and teardown. For small test suites, this overhead can become significant in proportion to the actual test execution time. Initialization Time: Parallel execution tools might take additional time for initialization, distributing the tests, and gathering results.
@niharshiplu11 ай бұрын
@@LambdaTest thanks for the clarification. 👍
@LambdaTest7 ай бұрын
Thank you
@johnfarrell41782 жыл бұрын
After running the parallel command "npm test" where test="mocha --no-timeouts -parallel" it only runs 1 js test successfully and the second test window remains open and does not navigate to the todo website. Any ideas what could be issue ?
@johnfarrell41782 жыл бұрын
Resolved my issue by using --max-parallel in the test command
@LambdaTest2 жыл бұрын
Glad to know John!
@user-pg7hj9qj1p Жыл бұрын
Hello Ryan, I really liked your tutorials, These lessons helped me a lot to understand and adopt the new platform, however, if you could create another updated version of these tutorials for Windows OS, it would be lot helpful. Thank you
@LambdaTest Жыл бұрын
Thanks for the feedback, Subscribe to our channel for more such tutorials! ✨
@diegomitmaariza749310 ай бұрын
Coul I install npm webdriver-manager instead donwload the web drivers? its the same, isn't? Thanks
@LambdaTest10 ай бұрын
Yes, webdriver-manager is a helpful tool for managing the WebDriver binaries used by Selenium. Using webdriver-manager, you can easily download the WebDriver binaries (like ChromeDriver, GeckoDriver for Firefox, etc.) required for your Selenium tests.
@coolbang26502 жыл бұрын
great video.. do you have tutorial for js implementation of cdp or bidi? network intercept or other examples would been great
@LambdaTest2 жыл бұрын
Thanks cool! Let us get back to you on this
@vitorqlima10 ай бұрын
Subscrited! Great tutorial, it's perfect!
@LambdaTest10 ай бұрын
Glad you liked it. Please subscribe to our KZfaq channel for more such videos 🌟
@videoportalfortesting68392 жыл бұрын
Cool video!
@LambdaTest2 жыл бұрын
Glad you enjoyed it
@mrcenobittas2 жыл бұрын
Awesome tutorial. how can i make the test close the browser when gets a error? in my test it continues open.
@LambdaTest2 жыл бұрын
Hey Daniel Can you try using driver.close(). Or setting a boolean flag and when the test fails, the boolean flag is set to true. And then using driver.close() or System.exit(1)
@ganeshkhirwadkar412711 ай бұрын
Amazing ! But I guess quality of videos could be enhanced as it deals with coding and people have to seeeeeee.
@LambdaTest11 ай бұрын
Sure, thank you for the feedback. We will definitely take this into consideration.We'll work on enhancing it to provide a better viewing experience.
@aquariusacademy Жыл бұрын
isn't Mocha like something different from Selenium? Why aren't you using grids
@LambdaTest11 ай бұрын
Mocha and Selenium serve different purposes. Mocha is a testing framework for organizing test cases, while Selenium is for browser automation. Combining them allows for structured and automated testing. Selenium Grid is indeed useful for parallel testing across browsers and platforms, and it can be integrated with Mocha and Selenium for even more efficiency.
@MightyCats20115 ай бұрын
Why use Javascript for Test Automation over Java? I think Java is more commonly used and more autocomplete e.g. you had to write require code selenium-webdriver. But in a IDE like Eclipse can autocomplete the require library lines
@LambdaTest5 ай бұрын
Hey there, Choosing JavaScript over Java for test automation, or vice versa, often depends on the specific needs of the project, team expertise, and the testing ecosystem you're working within. While Java is indeed a popular language for test automation, with extensive support and a rich ecosystem, there are several compelling reasons to consider JavaScript: Web Alignment: JavaScript is native to web development, aligning closely with web technologies and allowing for seamless integration in projects that use JavaScript for development. Modern Frameworks: JavaScript offers modern, powerful testing frameworks like Jest, Mocha, Cypress, and Playwright, designed for the dynamic nature of web applications, with features like real-time feedback and native browser API access. Simplicity and Speed: JavaScript can simplify the setup and execution of tests, especially in projects that already use JavaScript, providing faster development cycles and immediate feedback. Full-stack Compatibility: For projects using JavaScript across the full stack, testing in the same language can streamline development, allowing for shared code and easier management. While Java has its strengths, including robust IDE support and a mature ecosystem, JavaScript's alignment with web technologies and modern testing capabilities make it a compelling choice for many web application projects.
@magduchaes9212 жыл бұрын
Awesome tutorial, have silly question: according to 42m, why I don't see anything I output in my terminal? Test execute but don't have any status anywhere
@LambdaTest2 жыл бұрын
Hey Magducha, let us get back to you on this
@LambdaTest2 жыл бұрын
Hi Magducha, First of all, WebDriver JavaScript will not generate any Reports. If you mention any console messages, that you can see in the Visual Studio code Output tab. By Default, after code running completion you can see "[Done] exited with code=0 in 6.212 seconds" this statement in Output Tab.
@celiat2945 Жыл бұрын
hello, thx for the tutorial, but I have an issu with firefox. When I type "node tests/firstTest.js" in the terminal, firefox only open for 1sec, I can't see what's going on, no error message, just the search bar being red (? I don't know why). I'm on Windows, and I have no error in the VS terminal either, just the indication of my driver and browser Path. I really don't know what to do...
@LambdaTest Жыл бұрын
Hey there, It sounds like the Firefox WebDriver (Geckodriver) may be closing immediately after executing. Here are a few things you can try: Explicit Wait: Ensure you're using explicit waits in your script. This will allow the browser to pause and wait for certain elements or conditions. Debugging: Add more logging to your test to capture any issues that might be occurring but not displayed in the terminal. Update Drivers/Browser: Ensure that both Firefox and Geckodriver are updated to their latest versions. Check Configuration: Verify that your Selenium configuration for Firefox is set correctly. Red Search Bar: The red search bar may indicate an insecure or problematic URL. Ensure that the URL you're navigating to is correct. If these don't help, please share more details about your test script or configuration for a deeper look.
@beautyna1 Жыл бұрын
@ryantestsstuff hi! I am stuck on the first part and not sure why When I add the tests and the first test file and run the code after writing the first assertion i got an error Applicable driver not found; attempting to install with Selenium Manager (Beta).... I followed all instructions but could have missed something. Also when I added Mocha, and removed the 'tests/*js' from npx mocha --no-timeouts 'tests/*js' command, it didnt find the test file! why? when i add the follwoing command it works npx mocha --no-timeouts 'tests/*js' .
@LambdaTest Жыл бұрын
Hey there 👋🏻 The error "Applicable driver not found..." means Selenium WebDriver for your browser is missing. Ensure it's installed and properly set up. For your Mocha issue, npx mocha --no-timeouts 'tests/*js' tells Mocha to find JavaScript files in the "tests" directory. If you remove 'tests/*js', Mocha looks in its default "test" directory. So, if your tests are in "tests", you need to specify 'tests/*js' or Mocha won't find them.
@kenojayaguiar3143 Жыл бұрын
great video, has anyone ever told you that you look like Tobey Macguire?
@LambdaTest Жыл бұрын
I'm glad you enjoyed the video! Subscribe to our channel to never miss an update on the upcoming tutorials! ✨ And yes, I've heard that before 😊
@samaremad6878 Жыл бұрын
Hello Ryan, really it is good tutorial but i faced problem when i called node test/firstTest.js nothing happened please help me urgently i need to do that task
@LambdaTest Жыл бұрын
Hey Samar, One of the most common issue of not able to run the test is incorrect path directory. Can you please recheck. Also please see if you have installed all the dependecicies required to run the test. Please let us know if this helps.
@vicohadiansyah43 Жыл бұрын
Hi igot error like this succses fully add on todo list: WebDriverError: Unauthorized, either Username or AccessKey is invalid.
@25dados Жыл бұрын
Same problem here.
@25dados Жыл бұрын
Found this in the comments and it worked for me: "I believe the problem was when I was importing the values from capabilities.js file. When I input the same values directly in the test.js file under variables, it worked."
@25dados Жыл бұрын
Found the problem. Things changed since the video was released and the capabilities are expressed diferently now. In the test sheet, you have to add and additional step before the .username and .accessKey to invoke the object with the options: //username const USERNAME = ltCapabilities.capabilities["LT:Options"].username; //key const KEY = ltCapabilities.capabilities["LT:Options"].accessKey; That´s it!
@LambdaTest10 ай бұрын
Thanks, for sharing the updated version. You can also read more capabilty configurations through our Support Docs www.lambdatest.com/support/docs/
@abiodunodusanya10 ай бұрын
@@25dados it worked for me. Thank you!
@stevanoliveira5949 Жыл бұрын
Hello. I'm stuck at the beginning, when I first try to launch firefox using the command 'node tests/firstTest.js' nothing happens when I send it. I have already downloaded the browser and also put the gecko path as an environment variable =/
@LambdaTest Жыл бұрын
Hey Stevan, Can you please try once again deleting the node_modules folder and reinstalling the 'selenium-webdriver' package with 'npm install selenium-webdriver'
@MrProtodox7 ай бұрын
Hey Ryan, I installed Chai and when I run the test I get the following error. I did everything according to your example: Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/.../firstTest.js not supported. Instead change the require of chai.js in /Users/.../firstTest.js to a dynamic import() which is available in all CommonJS modules. at Object. (/Users/.../firstTest.js:3:14) { code: 'ERR_REQUIRE_ESM' } Node.js v20.10.0
@LambdaTest7 ай бұрын
Hi , thank you for reaching out and sharing the error you encountered. Our team is currently investigating this, and we'll get back to you soon with a solution or guidance on how to resolve this particular problem. Your patience is appreciated!
@IbadetIsmayilovАй бұрын
Hello. I was wondering if you solved this error. I really need a solution. Could you please provide a solution for this one?
@IbadetIsmayilovАй бұрын
@@LambdaTest Hello. I was wondering if you solved this error. I really need a solution. Could you please provide a solution for this one?
@levanigogaladze89342 жыл бұрын
It is always hard for me to set up mocha configuration on javascript it always gives me errors like that. Error: No test files found: "test", ReferenceError: describe is not defined. I searched it on StackOverflow but it does not make sense.
@LambdaTest2 жыл бұрын
Hi Levani, Let us get back to you on the same.
@javastaker Жыл бұрын
Greetings, my browser Chrome, closes a few seconds after executing the function example.
@LambdaTest Жыл бұрын
Hey Javastaker 👋🏻 If the issue still persists, can you update your dependencies and try again. Please let us know
@puneetoist19872 ай бұрын
Mochawesome folder is not generated when using --parallel flag. Anything changed there ? It works when i remove the --parallel flag
@LambdaTest2 ай бұрын
Hey @puneetoist1987, you can try looking at the official document when dealing with parallel Mode: www.npmjs.com/package/mochawesome#parallel-mode
@tatjanavasovicbursac4353 Жыл бұрын
This course was an eye-opening, since I've done automation in Cypress only, and once I saw how you included Mocha and Chai assertions it basically looks the same to me...So can you explain to me if there's difference in the code writing, between those two automation tools, meaning Cypress and Selenium?
@LambdaTest Жыл бұрын
Hey Tatjana, Hope the session was helpful ! There are syntax differences between the frameworks.
@robswiderski Жыл бұрын
Hi i have problem with running an example from your tutorian on lambda test cloud. Locally it was working fine. But after modufication of script from chapter 7 (adding cloud Lambda test) I receive an error after npm test in terminal "" 1 passing (6s) 1 failing 1) Uncaught error outside test suite: Uncaught ReferenceError: capabilities is not defined" Any idea whot might be wrong?
@LambdaTest Жыл бұрын
Hey Robert, For configuring tests you need to add desired capabilities. Please have a look here: www.lambdatest.com/support/docs/selenium-automation-capabilities/
@Hi570642 жыл бұрын
Good content.
@LambdaTest2 жыл бұрын
Glad you enjoyed it
@havefun9380 Жыл бұрын
when we login try with one driver browser, and login with multi user level can selenium do it?
@LambdaTest11 ай бұрын
Hey there, Yes, Selenium can handle multi-user level testing. You can create multiple WebDriver instances, each representing a separate user session. This allows you to simulate concurrent user interactions on your website or application. Just make sure to manage your WebDriver instances and user actions accordingly in your test script.
@havefun938011 ай бұрын
@@LambdaTest thank you for the answer, i will trying it
@LambdaTest6 ай бұрын
You're welcome! If you have any further questions or need additional assistance, feel free to ask. Good luck with your efforts!
@x-men61802 жыл бұрын
Hello sir, how can I scroll up and down. Because some web page don't load all results, they load dynamically when you scroll down. So how can I able to scroll up and down. Please help
@LambdaTest2 жыл бұрын
Hey 👋🏻, Can you try using js.executeScript("window.scrollTo(0, document.body.scrollHeight)"); You can also read more about automated scrolling here: www.lambdatest.com/blog/scroll-a-webpage-in-selenium-using-java/
@katialee12992 жыл бұрын
Thank you so much for the tutorial! it is great so far but for some reason the new browser window is not opening up for me. Can anyone help me get unstuck please.
@LambdaTest2 жыл бұрын
Thanks Katia. Let us get back to you
@LambdaTest2 жыл бұрын
Hi Katia, Make sure you have downloaded compatible browser driver based on your Browser version. if not please use WebDriverManager .
@jacobjones67942 жыл бұрын
At 8:16 you said that we needed to update the path. I use windows and I went to the Environment Variables, but I am not sure what to look for exactly in there. Can you please help me figure that part out. Because when I tried doing the first test example in my VSCode, it says, "code: 'MODULE NOT FOUND',"
@HumorToVivoTv2 жыл бұрын
you need to add this information, in the path of the system variable, just locate, and click to edit, and add a new line with the path
@LambdaTest2 жыл бұрын
Hey Jacob, Let us know if you are able to resolve
@jacobjones67942 жыл бұрын
@@LambdaTest I was able to resolve it! Once you go into Environment Variables, you double click on the PATH variable and then you copy and paste your file route there.
@dth28816 ай бұрын
Is there anyone have the same my error when do chai assertion like this: "[ERR_REQUIRE_ESM]" , I need some help, please ! :)
@LambdaTest6 ай бұрын
The error [ERR_REQUIRE_ESM] you're encountering is typically related to trying to require() an ECMAScript module (ESM) in Node.js, whereas ESM modules use the import statement for loading modules instead. This issue arises because Node.js treats JavaScript files as CommonJS modules by default, which use require() for importing modules, but if a module (like some versions of Chai or other dependencies you're using) is designed as an ESM, you must use the import syntax to include it in your files. Here are a few ways to resolve this issue: 1. Use Import Syntax If your environment supports ES Modules (e.g., a recent version of Node.js), you can switch to using the import statement instead of require(). For example: // Instead of const chai = require('chai'); import chai from 'chai'; 2. Update package.json to Use ES Modules You can explicitly tell Node.js to treat your JavaScript files as ES Modules by adding "type": "module" in your package.json: { "type": "module", ... } This change means you'll have to use import and export statements instead of require() and module.exports throughout your project. 3. Use Dynamic Import() for ESM Packages If you need to keep using CommonJS syntax for other parts of your project but want to import an ESM module, you can use a dynamic import() statement, which returns a promise: import('chai').then(chai => { // Use chai here }); This approach can be less convenient if you're using Chai for synchronous assertions, but it's a workaround for mixing ESM and CommonJS modules.
@dth28816 ай бұрын
@@LambdaTest Thank you very much and I appreciate your helping
@murlocchieftain986225 күн бұрын
Adding on to this for anyone who sees this in the future, I found that only the following worked, after setting "type": "module", in the package.json file. import { should } from 'chai'; should(); additionally, you have to convert the other const {} = require("thing") into import syntax when doing this e.g. replace this: const {Builder, By, Key} = require("selenium-webdriver"); with this: import {Builder, By, Key} from "selenium-webdriver"; I'm just learning this and I can see why we have to specify what is imported from chai, but I have no idea why we have to run should() first in order to use it later but that's the only way this worked for me.
@boyapatiramakrishna20682 жыл бұрын
How to run the selenium code in the html page with the invoke of a button. You told to run from the terminal. It is fine. Please tell me how to run it from the html page with the click of a button.
@LambdaTest2 жыл бұрын
Hi BK, let us get back to you
@LambdaTest2 жыл бұрын
Hey BK, The optimal solution is create a Jenkin freestyle project, call the Jenkin API in UI Button programmatically
@boyapatiramakrishna20682 жыл бұрын
@@LambdaTest Thank you very much for your reply. I will go through it and see how it works.
@eflick Жыл бұрын
Is this posted somewhere else in better quality? 720p is terrible.
@LambdaTest Жыл бұрын
Hey Eric, Thanks for your suggestion. We will take of this 😇
@tejastoley67148 ай бұрын
Hello Ryan, when i run the script it throws the error Error: Cannot find module 'node:events' Require stack: - F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\lib\webdriver.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chromium.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chrome.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\index.js - F:\jsselenium\selenium\logintest.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js:18:26) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) { code: 'MODULE_NOT_FOUND', PS F:\jsselenium\selenium> node .\logintest.js internal/modules/cjs/loader.js:883 throw err; ^ Error: Cannot find module 'node:events' Require stack: - F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\lib\webdriver.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chromium.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chrome.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\index.js - F:\jsselenium\selenium\logintest.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js:18:26) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\bidi\\index.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\lib\\webdriver.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\chromium.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\chrome.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\index.js', 'F:\\jsselenium\\selenium\\logintest.js' ] } PS F:\jsselenium\selenium> node .\logintest.js internal/modules/cjs/loader.js:883 throw err; ^ Error: Cannot find module 'node:events' Require stack: - F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\lib\webdriver.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chromium.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\chrome.js - F:\jsselenium\selenium ode_modules\selenium-webdriver\index.js - F:\jsselenium\selenium\logintest.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15) at Function.Module._load (internal/modules/cjs/loader.js:725:27) at Module.require (internal/modules/cjs/loader.js:952:19) at require (internal/modules/cjs/helpers.js:88:18) at Object. (F:\jsselenium\selenium ode_modules\selenium-webdriver\bidi\index.js:18:26) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) { code: 'MODULE_NOT_FOUND', requireStack: [ 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\bidi\\index.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\lib\\webdriver.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\chromium.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\chrome.js', 'F:\\jsselenium\\selenium\ ode_modules\\selenium-webdriver\\index.js', 'F:\\jsselenium\\selenium\\logintest.js' ] }
@LambdaTest7 ай бұрын
Hey there, The error Error: Cannot find module 'node:events' suggests an issue with your Node.js environment or the way Selenium WebDriver is set up in your project. Here's how to troubleshoot and resolve this issue: Node.js Version: Ensure you're using a recent version of Node.js. The node:events module is a modern feature, and older versions of Node.js might not support it. You can check your Node.js version with node -v and update it if necessary. Reinstall Node Modules: Delete the node_modules folder and the package-lock.json file in your project directory. Run npm install to reinstall the project dependencies. Check Selenium WebDriver Version: Make sure you're using a compatible version of Selenium WebDriver. You can update it using npm install selenium-webdriver@latest. Revisit the Script: If the issue persists, there might be a specific problem with how the script is written. Check the logintest.js file for any unusual or incorrect usage of modules. Please let us know if you are still facing the issue
@tejastoley67147 ай бұрын
@@LambdaTest i have installed the latest version of node js
@LambdaTest7 ай бұрын
That's great! Having the latest version of Node.js will definitely enhance your development experience with LambdaTest
@damienosullivan63532 жыл бұрын
I am unable to get the test title inside the beforeEach() function with the below code: `ltCapabilities.capabilities.name = this.currentTest.title;` I get this error message: TypeError: Cannot read properties of undefined (reading 'title')
@LambdaTest2 жыл бұрын
Hi Damien, let us get back to you on this
@damienosullivan63532 жыл бұрын
@@LambdaTest Thanks for the response. I'm using Mocha ^9.2.1 if that's useful to you. I followed the code all the way, but can also share it if necessary. Thanks again!
@LambdaTest2 жыл бұрын
Hi Damien, Check beforeEach Method is inside describe block. And Check the variable name defined for reading capabilities.js file for ex: if you use different variable name const ltcaps=require("../capabilities") then this statement should be ltcaps.capabilities.name=this.currentTest.title;
@KaziMdRagib2 жыл бұрын
@@damienosullivan6353 check your capanbilities.js file if it looks like this below then, you have to access LT:Options property to get name. so you have to access like this, ltCapabilities.capabilities["LT:Options"].name = this.currentTest.title; capabilities.js file : var capabilities = { 'LT:Options': { "user": "*******", "accessKey": "*********", "build": "Test Build", "name": "Selenium Test", "platformName": "Windows 10", "selenium_version": "4.0.0" }, "browserName": "Chrome", "browserVersion": "100.0", } Let me know if it works or not!
@630hu10 ай бұрын
Can't find Javascript option on the Lambdatest Capabilities Generator. With Node.js it does not working. What should I do? Thnaks
@630hu10 ай бұрын
@LambdaTest could you please answer this? 1:48:01 , but we can not choose Javascript now.
@LambdaTest10 ай бұрын
Hey there, You can select the Language as NodeJS and Tool as Selenium. Please let us know if you face any issues.
@arunvishal45316 күн бұрын
Hi how to get autocompletion when you put driver. In
@LambdaTest2 күн бұрын
Hi Arun, In Selenium with JavaScript, to get autocompletion when typing `driver.` and ensure you are using a IDE like VS Code with the JavaScript or TypeScript language.
@arunvishal45312 күн бұрын
@@LambdaTest yes I am using vs code
@LD_12 жыл бұрын
Finally not indian tutorial...
@logiccomputer8000 Жыл бұрын
Do you hate Indians 🥲
@gtr19632 ай бұрын
agreed!!
@pongtester92062 жыл бұрын
nice
@LambdaTest2 жыл бұрын
Thanks
@MohitSheth-ir6qg4 ай бұрын
how can I take a screenshot in selenium js
@LambdaTest3 ай бұрын
Hey there, To take a screenshot in Selenium with JavaScript, you can use the takeScreenshot() method provided by the WebDriver API. This method captures the current state of the page as a screenshot in the form of a base64 encoded string. You can then write this string to a file to save the screenshot. Here’s how you can do it using async/await syntax in Node.js: const fs = require('fs'); const {Builder} = require('selenium-webdriver'); async function takeScreenshot() { let driver = await new Builder().forBrowser('chrome').build(); try { // Navigate to the URL you want to capture await driver.get('example.com'); // Take screenshot and get the result as a base64 encoded string let encodedString = await driver.takeScreenshot(); // Save the screenshot to a file fs.writeFileSync('screenshot.png', encodedString, 'base64'); } catch (error) { console.error(error); } finally { await driver.quit(); } } takeScreenshot();
@swapnapatil8907 Жыл бұрын
Hey Ryan I am getting below error while running firsttest.js throw new Error( ^ Error: Do not know how to build driver: Firefox; did you forget to call usingServer(url)?
@LambdaTest Жыл бұрын
Hey Swapna Make sure you have the necessary dependencies installed, including the correct version of Firefox and GeckoDriver. Double-check your code to ensure the WebDriver for Firefox is set up correctly and that you've called the "usingServer(url)" method with the appropriate URL. If you're using a testing framework, verify its configuration for Selenium and Firefox. Update to the latest Selenium WebDriver for JavaScript if needed.
@babemeltzer2 жыл бұрын
Is the todo-app site still available?
@LambdaTest2 жыл бұрын
Yes it is available. Here's the link for the same: lambdatest.github.io/sample-todo-app/
@AdijatAkande Жыл бұрын
How do we set gecko driver path for Windows machine?
@LambdaTest Жыл бұрын
Hey Adijat, To set the geckodriver path for a Windows machine,you have to download the latest version of the geckodriver executable from the official Mozilla releases page (github.com/mozilla/geckodriver/releases). Add the folder containing the geckodriver executable to the system's PATH environment variable. To do this: a. Open the Start menu and search for "Environment Variables". b. Click on "Edit the system environment variables". c. Click on the "Environment Variables" button. d. Under "System Variables", scroll down and find the "Path" variable. Select it and click "Edit". e. Click "New" and enter the path to the folder containing the geckodriver executable (e.g. "C:\geckodriver"). f. Click "OK" to close all windows. Restart any open command prompts or terminals to ensure that the new PATH environment variable is applied.
@a.t.43602 жыл бұрын
i have written 4 tests, running them parallel, not sure what happened.. but all 4 run successfully complete yet firefox wont close, any idea what i am doing wrong?????
@LambdaTest2 жыл бұрын
Hi A.T, let us get back to you on this
@LambdaTest2 жыл бұрын
Hey A.T, You can check the results; if any test case fails on assertion, the Next statement, which is driver.close(), dont get triggered.
@kingotkingovski2 жыл бұрын
ok i got to the part with the lambdatest test selenium grid and after doing everything i got these errors: "before each" hook for "successfully adds a todo to aplication": TypeError: Target browser must be a string, but is ; did you forget to call forBrowser()? "after each" hook for "successfully adds a todo to aplication": TypeError: Cannot read properties of undefined (reading 'quit') Also in the account i cant see anything in the dashboard.. it asks me what will i use lambdatest for.. And here what should i do? Thankyou for helping :D
@LambdaTest2 жыл бұрын
Hi Slavcho, let us get back to you on this
@kingotkingovski2 жыл бұрын
@@LambdaTest anything?
@LambdaTest2 жыл бұрын
Slavcho, we need to make sure "await driver.get("www.lambdatest.com/selenium-playground/radiobutton-demo") statement is added either in beforeEach block or it block.
@zzz_sleep39352 жыл бұрын
Your font size too small
@LambdaTest2 жыл бұрын
Thanks for the feedback Zzz....!...Will consider this point while working on the next video :)
@Junk-Junky Жыл бұрын
very nice tutorial, but my ears are done, sometimes the sound is so loud I had to take my headphones down, sometimes I cant hear a thing
@LambdaTest Жыл бұрын
Thanks for the feedback!
@Hespi.8 ай бұрын
Great tutorial, but the voice is a little bit bad.
@LambdaTest8 ай бұрын
Glad you liked it! Please subscribe to our KZfaq channel for more such videos 🌟
@j.k.ravshanovich2 жыл бұрын
Nice tutorial. But your identation style confuses beginners.
@LambdaTest2 жыл бұрын
Hey Jasurbek, Glad you liked the tutorial!...Do let me know which part you are referring to in particular, Will try to explain in simpler way.
@j.k.ravshanovich2 жыл бұрын
@@LambdaTest All indentations went to left inside the example function and describe. I know JavaScript ignores whitespace but it is still nice to have your code indented. I was following your instructions, at one point selenium opened the browser and closed immediately even though I didn't use driver.quit(). I was trying to compare my code to yours and I was a little confused. Still couldn't not find a issue. Then I resolved the issue in a traditional way; by restarting the computer 😁
@LambdaTest2 жыл бұрын
Thanks Jasurbek for your suggestions! We will makes sure we have all the best practices incorporated while we are working on the next set of videos :)
@chaits99sehgal4 ай бұрын
I don't understand what was the need to keep the drum music in the background, its so annoying.
@LambdaTest3 ай бұрын
Thank you for the feedback; we always appreciate identifying areas where we can improve. We will surely work on it.🙂
@NirajShrestha-wt4kp2 ай бұрын
not helpful for windows at all.
@LambdaTest2 ай бұрын
Hi Niraj, Could you please share more details about the issues you encountered on Windows?
@NirajShrestha-wt4kp2 ай бұрын
@@LambdaTest I had issue with setting up the Environment variables on windows. I was confused which variables to set: User variables or system variables. So, setup the same path in both user and system variables and it is working now. Thanks for your reply.
@strangelylookingperson2 жыл бұрын
My name is Ryan, I'm a robot.
@SarfrazECT Жыл бұрын
Hi Ryan. Thank you for such insightful Tutorial. Can you please help me here? I see this error when I am trying to execute my test on LambdaTest platform: WebDriverError: Unauthorized, either Username or AccessKey is invalid. at Object.checkLegacyResponse (node_modules\selenium-webdriver\lib\error.js:558:15) at parseHttpResponse (node_modules\selenium-webdriver\lib\http.js:579:13) at Executor.execute (node_modules\selenium-webdriver\lib\http.js:515:28) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
@LambdaTest Жыл бұрын
The error message indicates that your LambdaTest credentials are invalid. Check that you have entered the correct Username and AccessKey, which can be found in your account's "Profile" section. If still the issue persists please contact LambdaTest support for assistance support@lambdatest.com.
@SarfrazECT Жыл бұрын
@@LambdaTest thank you very much for your reply. I checked it and it was correct. I believe the problem was when I was importing the values from capabilities.js file. When I input the same values directly in the test.js file under variables, it worked.
@LambdaTest Жыл бұрын
Thanks Sarfraz ⚡️
@mounikareddy4539 Жыл бұрын
@@SarfrazECT Hello Sarfraz I am getting the same error. No matter what I changed it isn't working for me. can you please help me how you solved this? TIA
@anna-iz5op Жыл бұрын
I installed Mocha, wrote these describe and it functions and wanted to run the test. Unfortunately I have an error: Error: Not supported at Object.exports.doImport (/var/www/html/ania/newProject_git/node_modules/mocha/lib/nodejs/esm-utils.js:35:41) at formattedImport (/var/www/html/ania/newProject_git/node_modules/mocha/lib/nodejs/esm-utils.js:9:28) at Object.exports.requireOrImport (/var/www/html/ania/newProject_git/node_modules/mocha/lib/nodejs/esm-utils.js:42:34) at Object.exports.loadFilesAsync (/var/www/html/ania/newProject_git/node_modules/mocha/lib/nodejs/esm-utils.js:100:34) at Mocha.loadFilesAsync (/var/www/html/ania/newProject_git/node_modules/mocha/lib/mocha.js:447:19) at singleRun (/var/www/html/ania/newProject_git/node_modules/mocha/lib/cli/run-helpers.js:125:15) at exports.runMocha (/var/www/html/ania/newProject_git/node_modules/mocha/lib/cli/run-helpers.js:190:10) at Object.exports.handler (/var/www/html/ania/newProject_git/node_modules/mocha/lib/cli/run.js:370:11) at innerArgv.then.argv (/var/www/html/ania/newProject_git/node_modules/yargs/build/index.cjs:443:71) at process._tickCallback (internal/process/next_tick.js:68:7) at Function.Module.runMain (internal/modules/cjs/loader.js:834:11) at startup (internal/bootstrap/node.js:283:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3) Process finished with exit code 1 I thought that maybe I should update something but in package.json document everything looks fine. What's the problem? :( { "name": "newproject", "version": "1.0.0", "description": "Selenium Example Project", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "Ann", "license": "MIT", "dependencies": { "chai": "^4.3.7", "chromedriver": "^108.0.0", "mocha": "^10.2.0", "node": "^19.3.0", "selenium-webdriver": "^4.7.1", "webdriver": "^8.1.3" } } I also have another project, running on the same computer, probably with older version of node and mocha and everything works there.
@LambdaTest Жыл бұрын
Hey there, Can you delete you node modules and install them again. These configuration should work. Please let us know if you still face the same issue.
@anna-iz5op Жыл бұрын
@@LambdaTest unfortunately I still have the same problem.
@anna-iz5op Жыл бұрын
It started to work when I uninstalled Mocha and installed the older version, which is 8. I'm glad it works now but what's actually the problem? :) Does Node js version 19 not support the newest Mocha version?
@mohammadmohseni48622 жыл бұрын
hello thank you for your very good toturial. 😍 in section 6 your path for customizeDir is under the camera layer and not defined.🥲
@LambdaTest2 жыл бұрын
Hey Mohammad, thanks for liking the video. Let us check..