Yes Kushan it really solved many QA and Developer issues. Sure I will try to make more videos on Docker , in the meanwhile check Zelenium as well which works on Docker with Kubernates
Thank you Mukesh, For posting such a good video, I have a questing that Since Docker is similar to platform as service, can we have a container with WindowsOS from MAC machine ?
Hi mukesh, thanks for the video.it was a good learning to me. I have a question, how can be run selenium tests in parallel mode of same browser? for example I have 10 testcases, that needs to run parallelly in 5 different containers in chrome browser?
HI Priti, docker will platform for execution. Instead of running VM many companies prefer running on Docker. You can scale up and down depends on execution.
Hi Prashanth, By default node will be present inside docker container, if you wish to delete docker container then you can delete the running container.
Hi Mukesh, Thanks for the video. Docker is a vast subject in itself. From testing perspective what all is required? Is it just running he test on containers instead of VM's or Grid? Or do we have something more in pocket? 2nd question- This set-up is also achievable in local system by having both chrome and Firefox browsers installed and running the test in parallel. What additional are we achieving with this method? Waiting for the doubts to be cleared. :-)
HI Pankaj, I am glad that you asked this question. 1- Docker will provide you infrastructure so when you have to run test on VM which can handle 10 execution or 50 sessions. Lets assume you need to run 1000 test then you need another VM or VDI machine right, so instead for creating 10 VM you can use containers which are 50 times lightweighted as compared to VM's. please check my first video on Docker where I discussed the difference between VM and Container. last but not the least if you have less number of test and one VM is enough to run your test then you can VM or docker.
@@Mukeshotwani Thanks a lot Mukesh for responding. I believe with docker we can save the infrastructure cost as well. If we need our tests to run on different OS and different browsers than the VM's must have those OS and browser installed. However with docker we can setup infrastructure by pulling the required OS and browser image files.
Thanks for the video Mukesh, But the relationship setting command for a hub and different nodes(like chrome, Firefox) are missing. Can you please info on them ?
Basically, We need to run the hub, the respective nodes (firefox, chrome) that's being missed out in the video as the port number usage is also critical. Requesting info on this.
Hi Mukesh Thank you so much .awesome video😊. Could you please explain how to get the extend report on our local machine after the test execution on docker container
Hi Deepa by default reports will be in same machine from where you have executed the test. If you are have scripts in local machine but u r using Docker for only execution then reports will be in same machine.
Hi Mukesh When I try to open our application url in docker container, it is giving the error message "your connection is not private ".Same in Firefox too. But the url is working fine on my local machine. Do you know how to fix this?
I still have one more doubt... M using maven -chrome image from docker .. i can c my code is able to produce output which I provided in sysout however I wanted to open chromedriver for that I also used webdrivermanagager.. so my question is in this grid will be up automaticall
Hello Mukesh, thanks for the video and I could able to run successfully in docker. I have question regarding selenium/base. How we can run selenium test in this docker as it does not have chrome or firefox installed. Can you please explain this?
@@Mukeshotwani I think my question was not clear. There is a image available selenium/base where browser is not pre install. In this container how to execute selenium script?
Hi Mukesh, Is this using Selenium webdriver 4 alpha? The other question I have is whether do I need to setup selenium grid locally on my machine? Any help in this regard is really appreciated.
Mukesh, you have set the browser as Firefox and Chrome with the help of capabilities. I noticed that you were using Mac platform while you created the hub and node over docker. If we also want to set the platform like cap.setPlatform(Platform.WINDOWS)...will your code throw error? How can we have different platforms inside different containers the way we have created different browsers? Does our local operating system have any role in creation of container?
Hi Pankaj as of now container are linux containers so when u don't mention platform if takes default and run linux containers. You can connect your windows system as node to hub then when u mention platform windows then it will run on mode which is type of windows
@@Mukeshotwani Thanks for replying. Somehow i am getting confused in this concept. Please bear with me for following last set of queries. 1) How did you manage to create the Linux containers when you local system was having MAC operating system? 2) Are all the containers by default created on linux platform? 3) You mentioned that i can connect windows system as node to hub. Are you referring to traditional method of Selenium Grid concept? 4) Is it possible to create Windows or MAC Containers and run selenium nodes on them? Thank you in advance. :)
As of now All containers are linux containers. Windows container are possible but it will take some time because it is in beta phase. As of now if u need any other machines apart from linux then traditional way u have to connect with hub and then use the same.
Hello Mukesh, is it possible without using the desired capabilities class...my current project does not have the desired capabilities..how can i run it there
Hi Saurav we use Selenium Grid in order to run our Selenium test on different node. Without this i don't think it will work. In your framework you can create method for Remote Webdriver or modify existing method.
@@Mukeshotwani Could you please guide in that direction , Want to run scenarios in parallel on two different browsers ( Chrome and Firefox ) using Cucumber + TestNG
facing this error Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure. Please help am using docker tool box in windows 10 home. My Docker image is chrome standalone 85.0 and i dont have grid setup DesiredCapabilities cap=DesiredCapabilities.chrome(); URL u=new URL("0.0.0.0:4444/wd/hub"); and also tried URL u=new URL("localhost:4444/wd/hub");
When I execute my script in selenium it will connect to the container and it will enter the url in address bar when it starts to load it says no internet connect what is the solution for this
Hey Supriya, are you trying with your internal application? Please try running public application like google just to confirm that you are able to run the test on container. If that works then you can set the proxy via Selenium to run your test on container.
Hi Mukesh, Thanks for sharing the details. I am facing a very strange issue. After 1st successful test execution, if test is triggered for the 2nd time it container kind of hangs. Will have to stop chrome container and then it works. Below is what I see on the grid console window. 1 requests waiting for a slot to be free. Capabilities {browserName: chrome} View Config Thanks in advance, Meenakshi
same is the case with me also. 4 requests waiting for a slot to be free. Capabilities {browserName: chrome}Capabilities {browserName: chrome}Capabilities {browserName: chrome}Capabilities {browserName: chrome} not sure why this happens..
hi Mukesh, I am constantly getting an error "Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Session [(null externalkey)] not available and is not among the last 1000 terminated sessions. " the Hub & nodes are set up just how you have showed and code (using Intellij Idea is) : DesiredCapabilities cap = new DesiredCapabilities(); cap.setBrowserName(BrowserType.FIREFOX); WebDriver driver = new RemoteWebDriver(new URL("localhost:4445/wd/hub"), cap); driver.manage().window().maximize(); driver.get("www.google.com/"); Thread.sleep(10000); driver.quit(); Any help would be greatly appreciated.
@@Mukeshotwani Hi Mukesh, I have set up Zalenium and I can see the previews. When I run the test its exactly the same behavior, a chrome instance opens and then no activity followed by the same error "org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Session [(null externally)] not available and is not among the last 1000 terminated sessions. " Any more pointers would be very helpful. Thanks in advance
Hi Mukesh, I need your help in Required a password while connecting to my localhost: port number. 127.0.0.1:32762 (VNC Viewer). Where to find the password for this
Hi Mukesh, can we pass testng profile in docker compose file? I have different testng profiles for each client, i want to pass the profile name along with docker compose up comamnd. Please help Thanks
@@Mukeshotwani @@Mukeshotwani I am sorry I didn't write properly...I have multiple profiles with client specific xmls in pom.xml..I am using maven docker image and while starting docker-compose cmd I wanted to provide profile name, so it runs specific XML provided in the maven profile
Hi Mukesh, I have tried running docker but it ran once and said error..If I run again test get stuck in running mode but nothing happens..Pleas help me
How to run selenium from APIs with spring boot in docker I need to run required test cases from APIs please help me do one video on it. Actually api level is working in my local I'm facing issues when I run this in docker .
@@Mukeshotwani Hm, thanks a ton for the reply. I tried dedicating a lot of resourses to it, but still problems... I did find online, a known issue that running Docker on MacOS, containers have issues inheriting the hosts DNS, and have extreme lag in their own DNS. Will have to look into it more. But thanks again, great tutorial.
You are one of those people who make difference in the society with the knowledge! Good job!
Hi Vailabhav thanks for you kind word. Many thanks to u as well for being active member on channel.
How easily you have explained this concept. Superb ! Could you please shed some light on kubernetes as well.
Thanks a lot mate ✌️
Excellent Tutorials, Mukesh Ji. Right on spot...!!. I followed your steps... as is... and the execution when smooth like a butter... Thank You :-).
Thank you so much Krishna ji, I am glad it worked for you.
Great video mukesh. This is informative and precise, i was able to run the code in docker container successfully. Thank you so much!
great Purushotham 👍 and thank you 😊
Docker has made life so simple...amazing Mukesh ..please share some more tutorials !!
Yes Kushan it really solved many QA and Developer issues. Sure I will try to make more videos on Docker , in the meanwhile check Zelenium as well which works on Docker with Kubernates
You are on 🔥. Lot of thanks man.
Thank you Mukesh, For posting such a good video,
I have a questing that Since Docker is similar to platform as service, can we have a container with WindowsOS from MAC machine ?
Hi mukesh, thanks for the video.it was a good learning to me. I have a question, how can be run selenium tests in parallel mode of same browser? for example I have 10 testcases, that needs to run parallelly in 5 different containers in chrome browser?
Thanks Mukesh, really helpful.
Glad to hear that Thanks Mamun
Thanks mukesh for this video..what are the advantage of running selenium test on container and do companies will switch to docker for testing
HI Priti, docker will platform for execution. Instead of running VM many companies prefer running on Docker.
You can scale up and down depends on execution.
Super....learnt it.We have more topics in docker ...plz upload it those as well...
Yes Abhi, Next video in on Zelenium (Docker with Kubernates)
@@Mukeshotwani how can we create our own images and containers?
Hi Mukesh, Have a question here. After we execute our selenium tests in docker containers, How do we kill the nodes inside the Grid Console
Hi Prashanth, By default node will be present inside docker container, if you wish to delete docker container then you can delete the running container.
Hi Mukesh, Thanks for the video.
Docker is a vast subject in itself. From testing perspective what all is required?
Is it just running he test on containers instead of VM's or Grid? Or do we have something more in pocket?
2nd question- This set-up is also achievable in local system by having both chrome and Firefox browsers installed and running the test in parallel. What additional are we achieving with this method?
Waiting for the doubts to be cleared. :-)
HI Pankaj,
I am glad that you asked this question.
1- Docker will provide you infrastructure so when you have to run test on VM which can handle 10 execution or 50 sessions. Lets assume you need to run 1000 test then you need another VM or VDI machine right, so instead for creating 10 VM you can use containers which are 50 times lightweighted as compared to VM's.
please check my first video on Docker where I discussed the difference between VM and Container.
last but not the least if you have less number of test and one VM is enough to run your test then you can VM or docker.
@@Mukeshotwani Thanks a lot Mukesh for responding.
I believe with docker we can save the infrastructure cost as well.
If we need our tests to run on different OS and different browsers than the VM's must have those OS and browser installed. However with docker we can setup infrastructure by pulling the required OS and browser image files.
@@PankajSharma-pl3nq yes definitely it will save cost
Awsome Explanation! Can you suggest How to run CucumberBDD framework using Docker with headless?
Hi Mukesh, Thanks for the video
My pleasure Vasista
Hi Mukesh,
Thanks for explaining docker so well.
I need to know, how do you run automation suite on ECS cluster ?
Great Video
Thanks Dipak Bhai 😃
Thanks for the video Mukesh, But the relationship setting command for a hub and different nodes(like chrome, Firefox) are missing. Can you please info on them ?
Basically, We need to run the hub, the respective nodes (firefox, chrome) that's being missed out in the video as the port number usage is also critical. Requesting info on this.
Sure Tej let me check if I can add new video on this. Did you also check Zalenium, auto scaling containers czcams.com/video/PEjUCkNft7s/video.html
Hi Mukesh
Thank you so much .awesome video😊. Could you please explain how to get the extend report on our local machine after the test execution on docker container
Hi Deepa by default reports will be in same machine from where you have executed the test.
If you are have scripts in local machine but u r using Docker for only execution then reports will be in same machine.
@@Mukeshotwani thanks Mukesh. I will check and see why it is not being generated. Thanks for your response 👍
My bad , I forgot to call the rep.flush() function 😅
Hi Mukesh
When I try to open our application url in docker container, it is giving the error message "your connection is not private ".Same in Firefox too. But the url is working fine on my local machine. Do you know how to fix this?
Create some more tutorials on docker with selenium ...
I agree!!!
Hi Mukesh
Thanks for Ur videos..
To run selenium test on docker is it complousry to up grid
Hi Vrushali, yes Grid is used whenever you have to run test in VM/Docker/Cloud or any other machine.
I still have one more doubt... M using maven -chrome image from docker .. i can c my code is able to produce output which I provided in sysout however I wanted to open chromedriver for that I also used webdrivermanagager.. so my question is in this grid will be up automaticall
Hello Mukesh, thanks for the video and I could able to run successfully in docker. I have question regarding selenium/base. How we can run selenium test in this docker as it does not have chrome or firefox installed. Can you please explain this?
Hey Raju, docker image which we are using it creates container with browser installed (depends on which image you have used).
@@Mukeshotwani I think my question was not clear. There is a image available selenium/base where browser is not pre install. In this container how to execute selenium script?
Hi Mukesh, Is this using Selenium webdriver 4 alpha? The other question I have is whether do I need to setup selenium grid locally on my machine? Any help in this regard is really appreciated.
Mukesh, you have set the browser as Firefox and Chrome with the help of capabilities. I noticed that you were using Mac platform while you created the hub and node over docker.
If we also want to set the platform like cap.setPlatform(Platform.WINDOWS)...will your code throw error?
How can we have different platforms inside different containers the way we have created different browsers?
Does our local operating system have any role in creation of container?
Hi Pankaj as of now container are linux containers so when u don't mention platform if takes default and run linux containers.
You can connect your windows system as node to hub then when u mention platform windows then it will run on mode which is type of windows
@@Mukeshotwani Thanks for replying.
Somehow i am getting confused in this concept. Please bear with me for following last set of queries.
1) How did you manage to create the Linux containers when you local system was having MAC operating system?
2) Are all the containers by default created on linux platform?
3) You mentioned that i can connect windows system as node to hub. Are you referring to traditional method of Selenium Grid concept?
4) Is it possible to create Windows or MAC Containers and run selenium nodes on them?
Thank you in advance. :)
As of now All containers are linux containers.
Windows container are possible but it will take some time because it is in beta phase.
As of now if u need any other machines apart from linux then traditional way u have to connect with hub and then use the same.
Hi Is it possible to run selenium webdriver rather than selenium grid inside a docker container...
Nicely explained
Thank you so much 🙂 Deo
hi, When i try to execute the test script the same way as explained, a blank browser gets launched and returns with session id as null..plz advise
Hi Rasika, it means you are not using updated agent or you have updated chrome browser which is not compatible with TestProject.
Thanks for the great Video. Looks like VNC viewer is not open source, do we have any open source apps, please suggest
Hello Mukesh, is it possible without using the desired capabilities class...my current project does not have the desired capabilities..how can i run it there
Hi Saurav we use Selenium Grid in order to run our Selenium test on different node. Without this i don't think it will work. In your framework you can create method for Remote Webdriver or modify existing method.
@@Mukeshotwani yeah that should be the next option...i was just checking if it's possible without that or not...thanks for the answer 🙏
Hi Mukesh , can we run cucumber tests in parallel on two different browsers ?
Yes Apoorv why not.
@@Mukeshotwani Could you please guide in that direction , Want to run scenarios in parallel on two different browsers ( Chrome and Firefox ) using Cucumber + TestNG
Hi Mukesh is there any alternative of testng to dynamically route my test cases to different docker images. Tia
facing this error Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Please help am using docker tool box in windows 10 home. My Docker image is chrome standalone 85.0 and i dont have grid setup
DesiredCapabilities cap=DesiredCapabilities.chrome();
URL u=new URL("0.0.0.0:4444/wd/hub");
and also tried URL u=new URL("localhost:4444/wd/hub");
RemoteWebDriver driver=new RemoteWebDriver(u,cap);
HI Saimani, open this url in browser and see if hub is up and running or not
localhost:4444/wd/hub
Kindly post the video on how to retrieve the reports from the container
Hi Hari, report part will remain same because we are not changing anything from code except remote url.
Is it possible to launch chrome/firefox browser without using remote web driver inside a docker container
Hi Shaurya, Yes you need to use Selenium grid. Without grid you wont be able to triggerin remote machine.
When I execute my script in selenium it will connect to the container and it will enter the url in address bar when it starts to load it says no internet connect what is the solution for this
Hey Supriya, are you trying with your internal application? Please try running public application like google just to confirm that you are able to run the test on container. If that works then you can set the proxy via Selenium to run your test on container.
Hi Mukesh,
Thanks for sharing the details. I am facing a very strange issue. After 1st successful test execution, if test is triggered for the 2nd time it container kind of hangs. Will have to stop chrome container and then it works. Below is what I see on the grid console window.
1 requests waiting for a slot to be free.
Capabilities {browserName: chrome}
View Config
Thanks in advance,
Meenakshi
same is the case with me also.
4 requests waiting for a slot to be free.
Capabilities {browserName: chrome}Capabilities {browserName: chrome}Capabilities {browserName: chrome}Capabilities {browserName: chrome}
not sure why this happens..
hi Mukesh, I am constantly getting an error "Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Session [(null externalkey)] not available and is not among the last 1000 terminated sessions.
" the Hub & nodes are set up just how you have showed and code (using Intellij Idea is) :
DesiredCapabilities cap = new DesiredCapabilities();
cap.setBrowserName(BrowserType.FIREFOX);
WebDriver driver = new RemoteWebDriver(new URL("localhost:4445/wd/hub"), cap);
driver.manage().window().maximize();
driver.get("www.google.com/");
Thread.sleep(10000);
driver.quit();
Any help would be greatly appreciated.
Hi Pooja, Can you try with Zalenium czcams.com/video/PEjUCkNft7s/video.html
@@Mukeshotwani Hi Mukesh, I have set up Zalenium and I can see the previews. When I run the test its exactly the same behavior, a chrome instance opens and then no activity followed by the same error "org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Session [(null externally)] not available and is not among the last 1000 terminated sessions.
" Any more pointers would be very helpful. Thanks in advance
Hi Mukesh,
I need your help in
Required a password while connecting to my localhost: port number. 127.0.0.1:32762 (VNC Viewer). Where to find the password for this
password is secret
Hi Mukesh,
can we pass testng profile in docker compose file? I have different testng profiles for each client, i want to pass the profile name along with docker compose up comamnd. Please help
Thanks
Hi Mate, I am not clear with your requirement, What do you mean by testng profile here?
@@Mukeshotwani @@Mukeshotwani I am sorry I didn't write properly...I have multiple profiles with client specific xmls in pom.xml..I am using maven docker image and while starting docker-compose cmd I wanted to provide profile name, so it runs specific XML provided in the maven profile
How do we schedule these Docker tests to run at a specific time during the day?
You should have covered from scratch ... how to setup container is a big question now..
How do I practice brother
Hi Mate,I have already covered in channel, please check 😊
Here is the link czcams.com/play/PL6flErFppaj1quyeiIF8Rz7nlBPOZTk6d.html
@@Mukeshotwani thank you so much brother .. this will definetly help alot
Hi Mukesh, I have tried running docker but it ran once and said error..If I run again test get stuck in running mode but nothing happens..Pleas help me
Hi Jagadish, make sure you have enough memory if you are using docker containers
Can we install the Docker Hub/ Nodes on CentOS? How does the Chrome/Firefox browser work here on CentOS
Guruji at its best
hello ,Had
a doubt ,Is it necessary to write the script in Headless mode to run it in Docker with Aws
I am getting error while running the container "No such host is known", How to fix the issue. Can you please help me.
Hi Sachin, make sure hub is active and running before running the test.
Hi, My execution of test in browser is not showing what to do, I am only getting results pass fail
Hi Shazia, by default test will run headless mode.
Web driver exception session deleted because page crash. How to solve the issue
Use update image for grid which version u r using?
How to run selenium from APIs with spring boot in docker I need to run required test cases from APIs please help me do one video on it. Actually api level is working in my local I'm facing issues when I run this in docker .
connect: The requested address is not valid in its context. (10049). When I give the port in the vnc viewer, i get this error. Any solutions?
i've solved the problem by replacing 0.0.0.0:portNumber with localhost:portNumber
@@Margarita-sh3kr and password secret
It required a password while connecting to my localhost: port number. 127.0.0.1:32762 (VNC Viewer). Where to find password for this
The internet in the container is impossibly slow. Google can't load. Does anyone have any idea how to fix or debug this? The tests work fine locally.
Hi Over, container uses system resources so make sure system has enough resources to run test in container.
@@Mukeshotwani Hm, thanks a ton for the reply. I tried dedicating a lot of resourses to it, but still problems... I did find online, a known issue that running Docker on MacOS, containers have issues inheriting the hosts DNS, and have extreme lag in their own DNS. Will have to look into it more.
But thanks again, great tutorial.
hi Mukesh, how to validate the file being download in selenium docker container
Hi all ,anyone able to execute in chrome and firefox using docker images ,need help
Hey Vasista what issues are you facing?
hi @Vasista Have you done this. I need help in it
Does this work for selenium IDE?
how to run it on internal website..? How to setup proxy ? please share
Do you know Proxy class in selenium ?
@@Mukeshotwani yes..I have tried but. It did not work for me.
May be I did something wrong
@@gurinder22525 can u share code here
?
@@Mukeshotwani
public static WebDriver dockerChrome() throws Exception {
String url = "localhost:"+docker_local_port+"/wd/hub";
capabilities = new DesiredCapabilities();
Proxy proxy = new Proxy();
proxy.setHttpProxy("10.140.3.60");
capabilities.setCapability(CapabilityType.PROXY,proxy);
capabilities.setBrowserName(BrowserType.CHROME);
capabilities.setCapability(CapabilityType.ACCEPT_INSECURE_CERTS,true);
capabilities.setCapability(ChromeOptions.CAPABILITY, chromeOptions);
driver = new RemoteWebDriver(new URL(url),capabilities);
return driver;
}