Posts

Actions class in Selenium-Webdriver

Image
=> An API for simulating complex keyboard events and mouse events. => You can build a series of actions using the Action interface and Actions class.(Action chaining) eg:- To copy content in clipboard Actions builder = new Actions(driver); builder.keyDown( Keys.CONTROL ).sendKeys( "ac" ).keyUp( Keys.CONTROL ).build().perform(); => This is possible because methods of Actions class returns the Actions class object. => build() of Actions class compiles all events and returns object of Action interface. => perform() of Action interface executes all events.

Arguments in javascript to be used with JavascriptExecutor in Selenium script

Image
Signature of Method: Object executeScript(String script, Object... args) The arguments to the script may be empty or any object. It can be String object, WebElement, etc.. eg:-  ((JavascriptExecutor)driver).executeScript("arguments[0].click();", loginButton);  where "loginButton" is a WebElement. ((JavascriptExecutor)driver).executeScript("arguments[0].value=arguments[1]",emailTextField,"qacult");    where "emailTextField" is a WebElement.

Open new Tabs in Selenium script with javascript.

Image
for(int i=0; i<3; i++) { ((JavascriptExecutor)driver).executeScript("window.open('http://google.com', '_blank');"); }  U sing JavascriptExecutor interface executeScript() which executes the given script for opening tabs. ************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity.- We love to enhance your knowledge. QACult is the premier institute catering to the requirements of experienced and fresh pass-out that gives leaders like you a new way to experience Quality engineering—while you work and giving you the flexibility to both advance your career. Our faculty have 12+ years of industrial experience and have developed many automation testing frameworks in java using TestNG or BDD (cucumber) methodology. We expertise in developing automation testing frameworks in java, python, javascript, php, ruby(WATIR-webdriver & Capybara) and Appium....

FirefoxOptions & ChromeOptions

Image
 Both are the child class of MutableCapabilities which is also parent class of DesiredCapabilities. Both are used to handle properties of Firefox and Chrome browser via geckodriver and chromedriver respectively. Object of both these classes are passed an an argument to FirefoxDriver and ChromeDriver classes. ************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity.- We love to enhance your knowledge. QACult is the premier institute catering to the requirements of experienced and fresh pass-out that gives leaders like you a new way to experience Quality engineering—while you work and giving you the flexibility to both advance your career. Our faculty have 12+ years of industrial experience and have developed many automation testing frameworks in java using TestNG or BDD (cucumber) methodology. We expertise in developing automation testing frameworks in java, python, javasc...

RPA- Delivering High End Automation

Image
With the advent of game-changing technology,  RPA, Robotic Process Automation  is one of its kinds. The latest wave of RPA is all about replacing and simulating a repetitive and boring clerical task performed by humans, into its integration as a virtual workforce. No coding or human supervision is required for random process automation to work. This technology makes use of  RPA robots or bots  which capture the data utilizing the user interface to manipulate the applications. These bots interact with an in-house website, app, user portal, etc. and enable the software program, RPA to run on an end user's pc, laptop or mobile device. Bots execute the sequence of commands under some defined set of rules to carry out a business process. What are the different types of Robotic Process Automation technologies? RBA is divided into three broad categories, i.e.,  Probots, Knowbots, and Chatbots. Bots that follow repeatable and straightforward rules to pro...

Robot Framework With Python: An Open Source Framework For RPA

Image
Robot Framework is one of the most useful open source automation software available in the market for acceptance testing,  Robotic Process Automation (RPA) , and Automation Test-Driven Development (ATDD). The syntax used is accessible in the tabular data form. Also, it uses the keyword-driven approach for testing purposes. The testing capabilities of the Robot Framework can be extended when it is used with Python and Java. An efficient user can create new and higher-level keywords from the already existing keywords by using the same approach and syntax. The framework has a prosperous system of libraries, both internal and external having useful keywords. These keywords can be re-used as per the requirement. The core  Robot Framework is implemented using Python  and also runs on IronPython (JVM) and Jython (.NET). Libraries in Robot Framework Testing libraries are the source of actual capabilities for Robot Framework as they provide keywords. Many st...

Robot Framework in python with RIDE

Image
Robot Framework is a Python-based, easy to use and extensible keyword-driven test automation framework for end-to-end acceptance testing and acceptance-test-driven development (ATDD). It can be used for testing distributed, heterogeneous applications, where verification requires touching several technologies and interfaces.RIDE RIDE is a development environment (GUI) for Robot Framework test cases.Robot Framework user guide. *************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity .- We love to enhance your knowledge. QACult is the premier institute catering to the requirements of experienced and fresh pass-out that gives leaders like you a new way to experience Quality engineering—while you work and giving you the flexibility to both advance your career. Our faculty have 12+ years of industrial experience and have developed many automation testing frameworks in java using TestNG or BD...

Why is it better to use explicitly wait rather than implicitly wait in Selenium Web Driver?

Image
Hi Friend, Totally different concept for explicit wait and implicit wait. When Implicit wait defined, selenium waits for every element on page or screen to become available before it throws  NoSuchElementExeception. And Explicit wait is, when selenium waits for certain condition before performing any action on WebElement. Now see advantage of using explicit wait,where we can create WebbElement in different ways. For example WebDriverWait wait = new WebDriverWait(driver, 50); element=wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("loginButton"))); element=wait.until(ExpectedConditions.presenceOfElementLocated(By.id("loginButton"))); element=wait.until(ExpectedConditions.elementToBeClickable(By.id("loginButton"))); You can also see other implementations of these methods in webdriver API Now please see, how Webdriver methods can be used to wait dynamically for any element using these explicit wait methods. All of the be...

Is Selenium with Java automation testing a better career option now?

Image
Hi, When was this not a good option.  Java is a complete and secure language and most of the companies are still using selenium with java because java is most accptable and useful language. In Java you can create any kind of utility and integrate it with your selenium framework. Also after learning OOPS in java language, one can develop selenium framework in any other language too like python, ruby, javascript, php etc because meaning of OOPS is same in every language. But this is not vice-versa. I can give you my example, I am actually a java person but have developed selenium-frameworks in python, ruby, javascript, php too. So selenium with java is always a good option and is not going anywhere. It has already captured most of the market. ************************************************************************************** QACult Best Software Testing Courses in Chandigarh tricity.- We love to enhance your knowledge. QACult is the premier institute...

Provide source to selenium-webdriver jar in eclipse IDE to understand the flow.

Image
A jar file usually only contains class files and not the java files they were compiled from.  That's why eclipse is not opening the source code of that class or interface. (control+click) "Attaching" the source to a JAR means telling eclipse where the source code can be found. It is always helpful to attach the source of   selenium-server standalone jar  with your code. You can identify the class and its hierarchy. You can understand how the method of class is executing ans see its code. It makes it easier to debug the problem. For attaching source to selenium-server-standalone jar follow the following steps. 1) From url:  https://www.seleniumhq.org/download/  download java client library under Selenium Client & WebDriver Language Bindings section. (for ex- selenium-java-3.x.x.zip)  will be downloaded. 2) Extract this zip file in a new folder.  3) There will be  client-combined-3.x.x-sources.jar  in the extracted ...

How do I launch a batch file in a Selenium WebDriver project?

Image
Hi Friend, When you want to create utilty to run batch file for your selenium tests, its always useful. I am giving you example of creating utility in Java Language to run batch file. Create batch file on your desktop and name it as abc.bat and write inside it echo "He is learning automation" Now create Java main class import java.io.IOException; import java.io.OutputStream; public class CMDUtilityToRunBatchFile { public static void main(String args[]){ CMDUtilityToRunBatchFile testScript = new CMDUtilityToRunBatchFile(); execDOSCmd(); } public static void execDOSCmd() { try { // Execute command String command ="cmd /c start C:\Users\DreamBook\Desktop\abc.bat"; Process child = Runtime.getRuntime().exec(command); // Get output stream to write from it OutputStream out = child.getOutputStream(); out.write("cd C:/ /r/n".getBytes()); out.flush(); out.write("dir /r/n".getBytes()); out.close(); }...