You are demonstrating advance teaching/lecturing skills, as it is clear, understandable, simple and methodical. Your skills and tutorials prove your knowledge and how to pass it in a pragmatic approach. Thank you Raghav.
Great !! Thanks, Raghav, even I am not expert in JAVA. but while seeing this video, I understood. what is function and how to write code in the proper way. going for next one now :)
you can create a function with String parameter to choose the browser without changing the source code public static void setBrowser(String browserchoice){ browser=browserchoice; }
I tried Modular by myself i have done everything as you said in the video but i come across this error Exception in thread "main" java.lang.NullPointerException at FunctionProgram.FunctionCall.runtest(FunctionCall.java:39) at FunctionProgram.FunctionCall.main(FunctionCall.java:14) if browser = "Firefox" the its working fine but when i changed to Chrome then the above error occurred
While running test on Firefox browser, I don't need the below kind of line ? System.setProperty("webdriver.firefox.driver", projectLocation+"\\libs\\firefoxdriver.exe");
Hi Raghav, I have got an error when i try to run with chrome option.Below adding logs : Starting ChromeDriver 2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91) on port 13825 Only local connections are allowed. Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary (Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 138 milliseconds
hi ,I am beginner to selenium .i am getting error while to launch chrome web driver.After i down load chrome driver 2.21 ,i extracted folder and i could see only chrome driver application ,but could not found chromedriver.exe file .no where in my pc also.Without chromedriver exe file how can run my selenium code ? could u plz help me on this whre to find?
Hi , I got an error while executing the same program.Please help me to find a solution .Below are the logs : Exception in thread "main" java.lang.NullPointerException at test1.Browserlaunch.runTest(Browserlaunch.java:46) at test1.Browserlaunch.main(Browserlaunch.java:16)
Hello Raghav I just made my code modular but when I run the application show me an exception, but I can't find where is problem. the console show me this: Exception in thread "main" java.lang.NullPointerException at test.firstSeleniumTest.runTest(firstSeleniumTest.java:43) at test.firstSeleniumTest.main(firstSeleniumTest.java:15) and the line 43 is: driver.get("seleniumhq.org/"); and 15: runTest(); Can you help me to find the problem? Thank you
Hi Giselly, Maybe you gave the wrong spelling of firefox in if condition ( different than the one you gave in browser="" statement. I did the same mistake and got the same exception.
sir i have a small dout regarding selenium in python linux platform taking a screenshot element = driver.find_element_by_id("mstv") element.save_screenshot("new.png") save_screenshot is not working in linux but it is working fine in windows. any help please anyone here
Hi Noor, what is the error you are facing, Also check the path has forward slash / and not backward slashes \\ stackoverflow.com/questions/44389171/file-path-not-getting-set-using-save-screenshot-for-python-selenium-in-ubuntu
@@RaghavPal I found that when i change anything code and run java application it should run the last code ( i saved code, i refreshed) i just need to remove anything from "Referenced Library" and add again!
Should not be the case. If you have added ChromeDriver and chromedriver.exe in your code. When you save and run it should run on chrome. Just check it is running the same class. You can do a right click and run as..
You are demonstrating advance teaching/lecturing skills, as it is clear, understandable, simple and methodical. Your skills and tutorials prove your knowledge and how to pass it in a pragmatic approach. Thank you Raghav.
Hi Goran, Most welcome, humbled
I am addicted to your teaching style , flow , tone and voice. you are an amazing teacher sir.
So humbled to see your message Azad, thanks a lot
Great !!
Thanks, Raghav, even I am not expert in JAVA. but while seeing this video, I understood.
what is function and how to write code in the proper way. going for next one now :)
Great Ritesh, Keep learning.
Excellently Excellent !!, after watching ur 11th tutorial on selenium, i slowly moved to all the videos and learned a lot. Thanks dude !!
Great to know this Amar. Keep learning.
Excellent explanation....!!!!! was looking for this to implement in my project..keep posting such videos....Thanks again.....
Thanks for watching Kaustubh
Thanks Raghav, very good explanation!
Most welcome!
Very helpful...easy to understand & implement
Great to know that Govind
excellent , very well explained.
Glad it was helpful Sheetal
very nice concept! great work
Thanks a lot!
you can create a function with String parameter to choose the browser without changing the source code
public static void setBrowser(String browserchoice){
browser=browserchoice;
}
Hi Bilal, yes there are diff ways. I have started from basics.
Very good!
Thanks for watching Joe
Sir, how to handle negative testing in automation, please explain. Resources are not available on this topic.
Will plan something on this Balaji
I tried Modular by myself i have done everything as you said in the video but i come across this error Exception in thread "main" java.lang.NullPointerException
at FunctionProgram.FunctionCall.runtest(FunctionCall.java:39)
at FunctionProgram.FunctionCall.main(FunctionCall.java:14)
if browser = "Firefox" the its working fine but when i changed to Chrome then the above error occurred
Hi Sijo, will need to see your code and detailed logs. Can try some online help too
Hi Raghav, the issue was because else was missing in my second if condition. now its working fine. thanks!
While running test on Firefox browser, I don't need the below kind of line ?
System.setProperty("webdriver.firefox.driver", projectLocation+"\\libs\\firefoxdriver.exe");
Hi Deepak, you can use Webdriver manager for Automatic management of Selenium WebDriver binaries
github.com/bonigarcia/webdrivermanager
Hi Raghav,
I have got an error when i try to run with chrome option.Below adding logs :
Starting ChromeDriver 2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91) on port 13825
Only local connections are allowed.
Exception in thread "main" org.openqa.selenium.WebDriverException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=2.36.540470 (e522d04694c7ebea4ba8821272dbef4f9b818c91),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 138 milliseconds
Hi Prajuna, have you added chrome driver exe and provided its path. If yes pls post your code here so I can troubleshoot
yes i have added.Please check the below code:
package test1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import config.properties;
public class Browserlaunch {
public static String browser;
static WebDriver driver;
public static void main(String[] args)
{
//setBrowser();
properties.readproperties();
setBrowserConfig();
runTest();
properties.writeproperties();
}
//public static void setBrowser() {
//browser="firefox";
//}
public static void setBrowserConfig() {
if(browser.contains("Chrome"))
{
System.setProperty("webdriver.chrome.driver","F:\\Java programs\\selenium test script\\lib\\chromedriver\\chromedriver.exe");
driver= new ChromeDriver();
}
if(browser.contains("firefox")) {
System.setProperty("webdriver.gecko.driver", "F:\\Java programs\\selenium test script\\lib\\gecko driver\\geckodriver.exe");
System.setProperty("webdriver.firefox.bin","C:\\Program Files\\Mozilla Firefox\\firefox.exe");
driver= new FirefoxDriver();
}
}
public static void runTest() {
driver.get("www.twitter.com");
driver.quit();
}
}
Try changing chrome driver version
Thank you so much .
You're welcome Morna
Can I have the link of previous session!!!
Sure automationstepbystep.com/
hi ,I am beginner to selenium .i am getting error while to launch chrome web driver.After i down load chrome driver 2.21 ,i extracted folder and i could see only chrome driver application ,but could not found chromedriver.exe file .no where in my pc also.Without chromedriver exe file how can run my selenium code ?
could u plz help me on this whre to find?
Did you try here - chromedriver.storage.googleapis.com/index.html?path=2.33/
Hi ,
I got an error while executing the same program.Please help me to find a solution .Below are the logs :
Exception in thread "main" java.lang.NullPointerException
at test1.Browserlaunch.runTest(Browserlaunch.java:46)
at test1.Browserlaunch.main(Browserlaunch.java:16)
Hi Prajuna, do you have more logs to understand the cause.
HI raghav,
Thanks a lot for the reply.I got the solution .It's because i have given "=" operator instead of "contains" method
Please, could you make video how to upload the file with Jmeter?
Will create a video on it soon.
Hello Raghav
I just made my code modular but when I run the application show me an exception, but I can't find where is problem. the console show me this:
Exception in thread "main" java.lang.NullPointerException
at test.firstSeleniumTest.runTest(firstSeleniumTest.java:43)
at test.firstSeleniumTest.main(firstSeleniumTest.java:15)
and the line 43 is:
driver.get("seleniumhq.org/");
and 15:
runTest();
Can you help me to find the problem? Thank you
Hi Giselly, cannot make out the issue with these logs.
Hi Giselly, Maybe you gave the wrong spelling of firefox in if condition ( different than the one you gave in browser="" statement.
I did the same mistake and got the same exception.
sir i have a small dout regarding selenium in python linux platform taking a screenshot
element = driver.find_element_by_id("mstv")
element.save_screenshot("new.png")
save_screenshot is not working in linux but it is working fine in windows. any help please anyone here
Hi Noor, what is the error you are facing, Also check the path has forward slash / and not backward slashes \\
stackoverflow.com/questions/44389171/file-path-not-getting-set-using-save-screenshot-for-python-selenium-in-ubuntu
I do the same code and follow the steps but instead of opening chrome still opening firefox, what is the reason?
Check your code. You must have used Chrome Driver
@@RaghavPal I found that when i change anything code and run java application it should run the last code ( i saved code, i refreshed) i just need to remove anything from "Referenced Library" and add again!
Should not be the case. If you have added ChromeDriver and chromedriver.exe in your code. When you save and run it should run on chrome. Just check it is running the same class. You can do a right click and run as..
@@RaghavPal I added because of first time work very well! when you change for example URL save and run again still open the last URL
Will need to see your code and setup
whenever iam write this program i get nullpointexception
will need to debug your code
Can I have the link of previous session!!!
Hi Sajitha, yes can get all from here - automationstepbystep.com/