Found 871 Articles for Automation Testing

Does cypress support api automation testing also?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:49:20

226 Views

Yes Cypress supports API automating testing also. XHR is known as the XML HTTP Request. It is an API which is used as an object. Its methods pass data between a server and browser. An XHR object can obtain data from a server in the form of a Response.Cypress can not only be used for UI automation, but can also be used to supervise the network traffic by directly acquiring the XHR objects. It is capable of mocking or stubbing a Response. An XHR information is obatined in the Network tab in the browser.XHR HeaderResponseTo trigger an XHR request, the ... Read More

Using the Selenium WebDriver - Unable to launch chrome browser on Mac

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:48:37

2K+ Views

While working with Selenium webdriver, we may be unable to launch the Chrome browser on Mac. However, it can be avoided by following the steps listed below −Step1 − Navigate to the link:https://sites.google.com/chromium.org/driver/ and click on the download link of the chromedriver version which is compatible with our local chrome browser.Step2 − Click on the chromedriver link available for the Mac operating system.Step3 − Once the download of the zip file gets completed, unzip it to get the chromedriver.exe file. Save it to a desired location.Step4 − While mentioning the path of the chromedriver.exe file in the System.setProperty method, we ... Read More

Is it possible to handle Windows based pop-ups in Selenium?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:47:33

4K+ Views

Yes, it is possible to handle Windows based pop-ups in Selenium webdriver. Sometimes on clicking a link or a button, another window gets opened. It can be a pop up with information or an advertisement.The methods getWindowHandles and getWindowHandle are used to handle child windows. The getWindowHandles method stores all the handle ids of the opened windows in the form of Set data structure.The getWindowHandle method stores the handle id of the window in focus. Since the getWindowHandles method holds all the opened window handle ids, we can iterate through these handle ids with the iterator and next methods.To switch ... Read More

What is difference between Assert and Verify in Selenium?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:45:55

3K+ Views

There are differences between Assert and Verify in Selenium. Both of these are used to verify if a webelement is available on the page. If the Assert fails, the test execution shall be stopped.The moment an Assertion has not passed in a step, the test steps after that step shall be hopped. However, this can be avoided by adding a try-catch block and incorporating the Assertion within this block.So the flow of the program execution continues if the Assertion yields a true condition. If not, the following steps after the failed step gets bypassed from the execution.To overcome this issue, ... Read More

Selenium - Element is not clickable at point

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:04:09

7K+ Views

We can get the error - Element is not clickable at point while trying to click a link in Selenium webdriver. This is common in chromedriver as the Chrome browser determines an element with point location.When the position of an element is changing and we make an attempt to click on it, this error is encountered. This is because the element is present in DOM, but its position is not fixed on the page.There are some workarounds to fix this error as listed below −Adding the explicit wait. The webdriver can wait till the expected condition - visibilityOf(webdriver shall wait ... Read More

How do I keep a session alive for long Selenium scripts in automation?

Debomita Bhattacharjee
Updated on 25-Jun-2021 13:00:32

4K+ Views

We can keep a session alive for long Selenium scripts in automation. In Chrome browser, this can be achieved with the help of the ChromeOptions and Capabilities classes.Capabilities class can get the capabilities of the browser by using the method – getCapabilities. This technique is generally used for debugging a particular step in a scenario having a sizable amount of steps.First, let us try to input text in the highlighted edit box in the below page −Code Implementationimport org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.Capabilities; import org.openqa.selenium.By; import java.util.Map; import java.util.concurrent.TimeUnit; public class BrwSessionAlive{    public static void main(String[] args) ... Read More

How does Selenium Webdriver handle the SSL certificate in Edge?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:58:44

817 Views

We can handle SSL certificates in Edge browser with Selenium webdriver. This is done with the help of the EdgeOptions class. We shall create an object of this class and set the parameter setAcceptInsecureCerts to the true value.Finally, this information has to be passed to the webdriver object to get the desired browser settings. An SSL is a protocol designed to establish a secured connection between the server and the browser.SyntaxEdgeOptions e = new EdgeOptions(); e.setAcceptInsecureCerts(true);Code Implementationimport org.openqa.selenium.WebDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.edge.EdgeOptions; public class EdgeBrwserSSL{    public static void main(String[] args) {       System.setProperty("webdriver.edge.driver",       "C:\Users\ghs6kor\Desktop\Java\msedgedriver.exe"); ... Read More

How to automate instagram login page using java in selenium?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:57:53

2K+ Views

We can automate Instagram login page with Selenium webdriver in Java. To achieve this, first we have to launch the Instagram login page and identify the elements like email, password and login with the findElement method and interact with them.Let us have the look at the Instagram login page −Code Implementationimport org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; public class InstagramLogin{    public static void main(String[] args) {       System.setProperty("webdriver.gecko.driver",       "C:\Users\ghs6kor\Desktop\Java\geckodriver.exe");       WebDriver driver = new FirefoxDriver();       //implicit wait       driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);       //URL ... Read More

Why use Selenium WebDriver for Web Automation?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:56:44

324 Views

Selenium webdriver is used widely for web automation. This because of the reasons listed below −Selenium webdriver comes without any cost and we do not need to buy a license for its usage. We can just download and start using it for automating the test cases.Selenium webdriver can be used to stimulate human-like actions like drag and drop, keypress, click and hold, and so on. This is done with the help of the Actions class.Selenium webdriver has a very friendly API which makes it easier for the users.Selenium webdriver can support multiple languages like Java, Python, JavaScript, C# and so ... Read More

Why Selenium IDE is not used for dynamic Website testing?

Debomita Bhattacharjee
Updated on 25-Jun-2021 12:56:06

546 Views

Selenium IDE is not used for dynamic testing. It can be used for a quick solution for a simple automation scenario, but not for developing an entire regression suite. The reasons for doing so are listed below −Selenium IDE is a Firefox plugin and hence mostly compatible with only Firefox browser.Selenium IDE is majorly used for prototyping purpose and can be used to automate static web pages only. There can be multiple issues if we try to test a dynamic page with Selenium IDE.Instead of Selenium IDE, Selenium webdriver can be used since it provides a programming interface to identify ... Read More

Advertisements