Level5

Cookies in selenium

Cookies in selenium

Level5, Selenium
Cookies: Cookie is a piece  of information from website and saved by your web browser Cookies are a way of remembering users and their interaction with the site by storing information in the cookie file as key value pairs. It stores the login information like user name / email and password HTTP cookie is also known as a web cookie, a browser cookie or Internet cookie. One website cannot access the cookies set by other websites   Handling Cookie in Selenium : Each cookie is associated with a name, value, domain, path, termination, and status of whether it is safe or not. We validate the cookie using selenium,  selenium can parse all the cookies When testing a web application using the Selenium, you may need to create, update or delete a cookie to check the
iFrames in Selenium

iFrames in Selenium

Level5, Selenium
How To Handle Frames In Selenium Webdriver How To Handle Frames In Selenium Webdriver: Occasionally you will encounter the below error when trying to locate an element. One of the reason might be that the element is present within a frame. And when writing a test against them, you can easily get tripped if you’re not paying attention. You cannot directly identify an element present in an iFrame. First we have to switch to the frame and then we can identify the elements present using normal Selenium locators. In this article let’s see how to handle frames in Selenium Webdriver. Error: Exception in thread “main” org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:”id”,”selector”:”tinymce”} What is iFrame? A web page which i

Screenshots in Selenium

Level5, Selenium
Most of the time we think to Capture Screenshot in WebDriver when some kind of error or exception surfaces while practicing testing, to resolve the same WebDriver has provided us one interface TakesScreenshot for capturing the screenshot of web application and This interface provides one method names as getScreenshotAs() to capture screenshot in instance of driver. This getScreenshotAs() method takes argument of type OutputType.File  or  OutputType.BASE64  or  Output.BYTES. We have taken the screenshot with the help of getScreenshotsAs() method and  and now it’s time to copy this file somewhere in our file system or in our desktop. So for this purpose we further use copyFile() method of the FileUtils class. Let’s create a program that will take a screenshot of the page in PNG form