ExplicitWait, Take Screenshot and Navigate Back & Forward - Selenium WebDriver Session 7

ExplicitWait, Take Screenshot and Navigate Back & Forward - Selenium WebDriver Session 7

Naveen AutomationLabs

6 лет назад

125,817 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Kanika Gupta
Kanika Gupta - 15.09.2022 14:12

Sir, while giving explicit wait command, I am getting an error.
new WebDriverWait(driver, timeout).ignoring(StaleElementReferenceException.class)
Multiple markers at this line
- The constructor WebDriverWait(WebDriver, int) is undefined
- Line breakpoint:ExplicitwaitConcept [line: 28] - clickOn(WebDriver, WebElement, int)

Ответить
romi dey
romi dey - 30.05.2022 13:59

while taking screenshot, I need to use FileUtils.copyFile. and import org.apache.commons.io.FileUtils; but these are not working now, unable execute, Naveen Sir please help

Ответить
Desi Foodie
Desi Foodie - 26.11.2021 11:45

One quetion, here in CLickon fucntion, how we are understanding that the timeout provided is seconds only, in function we have not declared anywhere TimeUnit.seconds .Thanks

Ответить
Hakim Akbary
Hakim Akbary - 05.05.2021 07:28

In my case, the question about take screenshot is a bit harder! Suppose you go to a page, click on a link and a popup is displayed. You have to take screenshot of only that popup (not the whole page). Anyone knows how to do it? I know that it is possible with Python but I want to do it with Java. Any suggesstion how to do it?

Ответить
TUF Bro
TUF Bro - 09.03.2021 14:58

Hi how to use setsleep in cucumber frame work

Ответить
gaurav garg
gaurav garg - 12.01.2021 20:23

FileUtils not working use the below line..


File src = ((TakesScreenshot) driver ).getScreenshotAs(OutputType.FILE);

FileHandler.copy(src, new File("C:\\Users\\Gaurav\\Downloads\\hello.png"));

Ответить
Amit Bhardwaj
Amit Bhardwaj - 18.09.2020 15:14

nice explain perfect tutorial for selenium automation

Ответить
Gopal Namasivayam
Gopal Namasivayam - 15.09.2020 12:43

Hi Naveen, fileutils cannot be resolved while taking a screenshot when google . it says the latest version doesn't support FileUtils..pls help

Ответить
manisha katare
manisha katare - 06.08.2020 14:46

hi naveen i have tried lots of time screenshot code but it's not working, it's giving error in FileUtils
my code is
File src= ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(src, new File("C:\\Users\\Automation_start\\src\\image\\first.png"));

i have tried file handler code also

try {
FileHandler.copy(ts.getScreenshotAs(OutputType.FILE), new File("C:\\Users\\c-manisha.katare\\Desktop\\selenium pics\\Screenshot.png"));
} catch (WebDriverException e) {

} catch (IOException e) {

Ответить
shuchi sinha
shuchi sinha - 29.07.2020 15:01

Hi Naveen, i had started watching your videos.....Please could you send me the link of your code because i want to increase the font-size and to copy the takescreenshot lines.

Ответить
Akshay Morajkar
Akshay Morajkar - 29.07.2020 12:02

FileUtils has now Changed to FileHandler

Ответить
asp p
asp p - 03.06.2020 12:54

Hi Naveen, I just attended selenium interview and they asked me to write the code for taking screenshot . Your videos of selenium are superb and easy to understand. Eventhough i am a manual resource and recently i went through your videos and learnt selenium with my own interest and trying to attend interviews where i am gaining my confidence levels to answer. This was the first time i am attending selenium interview ,even though i know basic things i could not remember the code for entire selenium. I am practicing now and referring your videos which gives me boost my confidence. Thank you so much and keep uploading videos on new technologies. I will refer my friends . Hats off to you. No words to say.

Ответить
Suyog Ratnaparkhi
Suyog Ratnaparkhi - 15.04.2020 13:58

Hi, I am using mac machine. It is giving me error as "Exception in thread "main" java.io.IOException: Destination '/Users⁩/⁨suyog.ratnaparkhi⁩/Downloads⁩/⁨MySelenium⁩/screenshots' directory cannot be created.

Ответить
Gangabhavani Akepati
Gangabhavani Akepati - 19.03.2020 07:06

Hi Naveen, Thank you so much for the video and one question on this somehow could not able to import FileUtils.copyfile is there any way to fix it ??

Ответить
Jayanthi P
Jayanthi P - 09.03.2020 23:40

hi naveen..this video is really helpful..now the selenium version has changed right so will be any change in API 's??

Ответить
Kishore Talatam
Kishore Talatam - 11.02.2020 05:07

Hi All, if you face issues with saving the screenshot, use below code.


File scr = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
File toLocation = new File("C:\\Users\\Kishore Talatam\\eclipse-workspace\\seleniumPractice\\src\\seleniumSessions\\screenshots.jpg");
FileHandler.copy(scr,toLocation);


Thanks Naveen for your effort in making videos.!!!

Ответить
saiful islam
saiful islam - 21.09.2019 07:46

Hi Naveen, thank you so much for your hard work and your valuable time .Really appreciate your time and hard work. Your explanation is very simple and easy to understand. Please keep it up good work bro👏

Ответить
shweta Pandey
shweta Pandey - 07.09.2019 19:37

Best videos I saw yet

Ответить
priya singh
priya singh - 22.06.2019 20:07

vedio is also very good

Ответить
priya singh
priya singh - 22.06.2019 20:06

i love ur voice

Ответить
BharathKumar Asokkumar
BharathKumar Asokkumar - 09.06.2019 17:25

Hi Naveen, Thanks for the classes. I have a doubt. on your 'Navigations' code there was "driver.manage().window().maximize();" but while testing your window didn't get maximized, did any one noticed ? please clarify..

Ответить
kaivi3333
kaivi3333 - 03.03.2019 20:34

Hi Naveen Sir, i tried your code for screenshot but its not working. the error shows and says -the method copyFile(File, File) in the type FileUtils is not applicable for the arguments (File)
FileUtils.copyFile(src,new File(C:\Users\km\eclipse-workspace\seleniumcodespractice\src\demosel1\screenshot\google.png);
can you tell what i did wrong here? or way to fix it?
thank you in advance.

Ответить
SURAJ SINGH
SURAJ SINGH - 03.02.2019 12:30

Guys pls use below code for screenshots
TakesScreenshot scrShot =((TakesScreenshot)driver);
File SrcFile=scrShot.getScreenshotAs(OutputType.FILE);
File DestFile=new File("H:\\selenium new\\screenshots\\google.png");
FileHandler.copy(SrcFile, DestFile);

Ответить
S T
S T - 24.12.2018 07:22

excellent videos

Ответить
Swap The Gamer
Swap The Gamer - 08.12.2018 21:27

Hi Naveen Sir,
You taught some methods like Contains(),Starts-With.,Ends-With..in your dynamic xpath creation video and there is one more video of yours on customized xpath in which you covered iterating tables in which you covered preceding-sibling and following-sibling properties. Do you have anymore videos on tables which covers some more properties and is there any way to get rid of StaleElementException
Thanks for all your videos :)
Thanks in advance

Ответить
Sandipan Mallick
Sandipan Mallick - 06.12.2018 16:40

Hi Naveen...Thanks for this video. I am facing one problem. When i'm going back to the previous page using driver.navigate().back() then it's going back to the previous page that is working fine. But if the previous page has iframes then the previous page loads only the iframe part not the whole page after clicking on browser back button. It's throwing org.openqa.selenium.StaleElementReferenceException. Can you please help me how to resolve this issue?

Ответить
amit singh
amit singh - 28.11.2018 15:08

hi Naveen , m not able to take the screenshot with the code which you have given.. Could you please help me in this

Ответить
Syed Naqvi
Syed Naqvi - 20.11.2018 14:16

tried this but keep getting error not working for me

File src = ((TakesScreenshot) driver).getScreenshotAs(OutputType.FILE);

FileUtils.copyFile(src, new File("C:\Users\Owner\Desktop\selenium classes"));

Ответить
You are Fearless - Just Do It.
You are Fearless - Just Do It. - 15.11.2018 18:31

Hi Naveen, small doubt.. Any how implicitly wait is waiting for 40 seconds if explicit wait(5) suppose element is not found. then implicitly wait can handle this right..? Here can u pls elaborate bit more on diff between implicitly wait and explicit wait..
Thanks in advance.

Ответить
MANIKANTA R
MANIKANTA R - 15.08.2018 21:04

Is there any online compiler for practice Selenium

Ответить
sowmya reddy
sowmya reddy - 05.07.2018 07:45

Hai Naveen, Your videos are great.. I have a question for this video..I understood how to navigate from one webpage to another by using navigate to but how can we open it in a new tab? ie., opening google is my first function and I wanted to open amazon web page in a new page..How can i perform this operation? Please help me out with this question

Ответить
Akula Bhaskar
Akula Bhaskar - 18.06.2018 19:56

Hello Naveen What could be the reason for not getting Exception after 20 Seconds ?

Ответить
nitesh rawat
nitesh rawat - 18.03.2018 12:09

Hi Naveen ,
The FileUtils statement is no prompting to add IOException ,instead FileUtils cannot be resolved.I have checked and matched my code with your several times but unable to find the solution. Please can you help? Thanks in advance!\
Awesome Vids btw :)

Ответить
Rahul Shimpi
Rahul Shimpi - 11.03.2018 08:37

Greate video. Thank you so much for providing information.

Ответить
Varsha b
Varsha b - 10.02.2018 05:10

Hi Naveen,

Your videos are very nice. Your way of explanation is straight to the point and neat.Thank you so much for sharing ur knowledge.

If we declare implicit wait, it is applicable to all elements in the web page.Then what is the purpose of declaring explicit wait?What is the difference between these 2 waits?Kindly reply.Also please make a video on manual testing FAQ's or manual testing imp topics...JMeter and other imp topics.

Ответить
Ritesh Choithani
Ritesh Choithani - 25.01.2018 17:36

Hi Naveen,
The page of cities and state is not displayed.
but all the videos are really helpful
Thanks a lot.

Ответить
Sridhar Rajendran
Sridhar Rajendran - 31.12.2017 21:03

What is the difference between implicit wait and explicit wait?

Ответить
Praveen Kumar
Praveen Kumar - 28.12.2017 11:48

What do U mean external URL? I mean what is difference between external URL and Normal URL?

Ответить
Kartik Kulkarni
Kartik Kulkarni - 08.11.2017 17:59

Hi Naveen,

What is the difference between FileUtils.copyfile() and File.copy()
I have tried import org.apache.commons.io.FileUtils; but was throwing an error, later I imported form import com.google.common.io.Files; which worked fine for me.

It would be great if you can help me to understand.

Ответить
my focus
my focus - 24.09.2017 17:12

thanks for sharing

Ответить