Posts

Showing posts from April, 2019

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 cat

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 items. 4) Copy  client-combi

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(); }

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(); } c

Navigate to url, enter Text or click on webelement with Javascript using JavascriptExecutor Interface in selenium and understanding its arguments

Image
JavaScriptExecutor  is an Interface implemented by RemoteWebDriver class that helps to execute JavaScript through Selenium Webdriver. It has two methods which help in executing javascript on a webpage. We will use its executeScript() method to execute javascript. 1)  Object executeScript(String javascript, Object... args) -  It takes first parameter as the JavaScript to execute, and second parameter is any arguments to the script and may be empty. This method returns Object which may be Boolean, Long, Double, String, List, Map or WebElement or null. Lets explain how we can execute javascript on a webpage with this method. Snippet-1   This uses javascipt to navigate to an URL WebDriver driver = new FirefoxDriver(); JavascriptExecutor executor =(JavascriptExecutor)driver; executor.executeScript("window.location.href = 'https://app.box.com';");     Snippet-2  Click on a web element using javascript only having element id "login-email"

SPECIALIZED COURSE FOR EXPERIENCED PROFESSIONALS OF 45 CLASSES

Image
We provide the right training platform and the skills required to carve out the desired profile in the industry. This course offers a detailed coverage of software testing concepts and it's use in testing of real time projects. This course covers every aspect of Automation testing along with core java concepts.Here is your chance to learn good QA Automation Testing with Industrial standards. We have designed a specialized course for experienced professionals of 45 classes. 1) Core Java (8-10 classes) a) Object Oriented programming b) Interfaces, Packages, Java Classes c) Data-Types, Arrays, Loops d) Primitive Classes, String Class & Collections 2) Introduction To Automation Testing and Selenium Webdriver (2 classes) a) What is Automation Testing b) Need for Automation c) Various Automation Tools d) Types of Automation Frameworks e) Benefits of Automation f) Introduction to Selenium and Selenium Components g) Supported Browsers h) Concept of web

Cucumber vs TestNG

Image
Friends, any confusion with what is cucumber and what is TestNG  In Automation, both are used to test smallest testable parts of an application, called units.  Cucumber features(tests) are written in plain english language which is actually a Gherkin language.  Another point is cucumber can be implemented with web driver-implementation in java, ruby, php, python etc.  Implementing cucumber with your tests form BDD (behaviour driven development) framework. Unit testing is a part of the test-driven developthement (TDD) methodology that requires developers to first write failing unit tests. Then they write code in order to change the application until the test passes. Nowadays, unit testing is done with BDD(Behavior Driven Development) which is extension of TDD where user or tester create the automated specifications in plain english language and developer write the underlying code that implements the test.   ****************************************************************

TestRail - Test Case Management Software for seamless integration

Image
TestRail is a web-based Test management tool that helps to manage and track the software testing efforts and organize the QA department.    • Web interface makes it easy to create test cases, manage test runs and coordinate the entire testing process. • Easily track and follow the status of individual tests, milestones and projects with dashboards and activity reports. • Get real-time insights into your testing progress and boost productivity with personalized todo lists, filters and email notifications. • Directly integrate TestRail with your favorite tools, including JIRA, Redmine, FogBugz, Selenium and more. • TestRail is the only tool that integrates with any JIRA version and edition, including JIRA Server and Cloud.   TestRail helps testers, developers and team leads to efficiently manage, track and coordinate software testing efforts, all from a centralized and easy to use web application. **************************************************************

Working with JSON Wire Protocol: Selenium

Image
INTRODUCTION Selenium is a browser Automation tool which uses JSON Wire Protocol All implementations of WebDriver that communicate with the browser, or a RemoteWebDriver server shall use a common wire protocol. This wire protocol defines a RESTful web service using JSON over HTTP. The wire protocol is implemented in request/response pairs of "commands" and "responses". Step1 - Download Selenium Stand Alone Server. Step2 - Download any Driver.exe. ie geckodriver for firefox or chromedriver for ch Step3 - Keep both Files in same folder(JSON)-    D:\selenium-server\JSON Open cmd and run the following commands- cd D:\selenium-server\JSON and give this command to start selenium server -              java -jar selenium-server-standalone-3.14.0.jar (Allow the access, and you will see - Launching a standalone Selenium Server on port 4444 Selenium Server is up and running on your port 4444)  in your browser  -    http://localhost:4444     -         and then C