testing Archives | Online Productivity Solutions Pvt. Ltd. Mon, 14 Oct 2019 06:25:01 +0000 en-US hourly 1 Check and Re-check https://opspl.com/blog/check-re-check/ https://opspl.com/blog/check-re-check/#respond Fri, 24 Aug 2018 12:24:47 +0000 https://opspl.com/?p=7305 Did I put off the lights? I better go check it out. Did I lock the front door? I think I did, but still, let me be sure about it. Have I put off the geyser? I better go and see if it is off before I leave. In our day-to-day life, we all feel...

The post Check and Re-check appeared first on Online Productivity Solutions Pvt. Ltd..

]]>
Did I put off the lights? I better go check it out. Did I lock the front door? I think I did, but still, let me be sure about it. Have I put off the geyser? I better go and see if it is off before I leave.

In our day-to-day life, we all feel the need to recheck and assure ourselves that we do not neglect anything that might be dangerous. When we are worried about something else or in a hurry or under pressure, it’s common to make mistakes. That’s natural!!! During these situations, it is necessary that we double-check our work.

It is said that rechecking leaves your memory in doubt but avoiding it also does the same.

When we are dealing with clients, we have to use this technique of rechecking. Whether you write an email to the client or prepare a user manual or write test cases, etc., everything needs to be rechecked from the start of the project till the end.

We can always use various online tools that are available for checking our content for grammar and spellings. Here’s when Google comes to our rescue!!! When it comes to testing (in the IT field), it’s not a one time job. Once a module is tested, testing is not complete for that module. In fact, testing should be carried out when the other module is integrated, to ensure that there are no major issues in the future. Here too, re-testing is necessary.

There are certain clients who are “Perfecto”, they need perfection in whatever they do. To tackle these type of clients, we have to recheck the quality of work that we produce for them. This is how we will build a good relationship with the client. Michael LeBoeuf (American business author) says, “A satisfied customer is the best business strategy of all.”.

In order to be perfect, let’s try the technique of RE-CHECK…

Revie Lobo

The post Check and Re-check appeared first on Online Productivity Solutions Pvt. Ltd..

]]>
https://opspl.com/blog/check-re-check/feed/ 0
Guidelines for writing Selenium automation https://opspl.com/blog/guidelines-writing-selenium-automation/ https://opspl.com/blog/guidelines-writing-selenium-automation/#respond Fri, 23 Feb 2018 12:28:40 +0000 https://opspl.com/?p=6702 Automated testing is the best way to increase the effectiveness, efficiency, and coverage of your web application. Automation can be helpful not only to debug the code but also to find the root cause of the defect by identifying the code section that is error-prone. This can be carried out through tests with Selenium WebDriver...

The post Guidelines for writing Selenium automation appeared first on Online Productivity Solutions Pvt. Ltd..

]]>
Automated testing is the best way to increase the effectiveness, efficiency, and coverage of your web application. Automation can be helpful not only to debug the code but also to find the root cause of the defect by identifying the code section that is error-prone. This can be carried out through tests with Selenium WebDriver for web applications and Appium for native and mobile web applications.

Selenium is a testing framework to perform web application testing across various platforms like Windows, Mac, and Linux. Selenium supports only web-based applications that need a browser open. To execute the script on different browsers, we need the driver of that browser.

It supports various programming languages such as Java, PHP, C#, Python, Groovy, Ruby, and Perl for writing the test automation scripts. It offers recording and playback action features to write tests.

Below are the basic requirements for running a Selenium Java script.

Importing Packages

Two important packages that a tester needs to import when starting to code a script are:

  • openqa.selenium.*- This package includes the WebDriver class needed to instantiate a new browser loaded with a specific driver.
  • openqa.selenium.firefox.FirefoxDriver – FirefoxDriver class instantiates a Firefox-specific driver.

As the project would grow, it is evident and logical that we may need to introduce several other packages for more complex and distinct functionalities like database connectivity, manipulating external files, logging, assertions, accessing another class, taking browser screenshots etc.

Instantiating objects and variables

For Selenium automation, the very first line of code comes as:

WebDriver driver = new FirefoxDriver();

To initiate a driver, we create a reference variable for the WebDriver interface and instantiate it using FirefoxDriver class. It means that we are defining a reference variable (driver) whose type is an interface. Any object we assign to it must be an instance of class FireFoxDriver or any other drivers that implement that interface.

A default Firefox profile will be launched which means that no extensions and plugins would be loaded with the Firefox instance and that it runs in the safe mode.

Selenium WebDriver makes direct calls to the browser using each browser’s native support. How these direct calls are made, and the features they support depends on the browser you are using. Selenium standalone server uses this driver to start the browser of your choice. Normally to run webdriver, we just need a browser and a selenium server jar file. Selenium supports to run webdriver on the browsers by adding a .exe path of the driver server for the individual browsers.

Here are the code snippets for Firefox, Chrome and IE:

Firefox

System.setProperty(“webdriver.firefox.bin”,”F:\\Program Files(x86)\\Firefox\\Firefox.exe”);

WebDriver driver = new FirefoxDriver();

driver.navigate().to(“https://www.google.com”);

Chrome

System.setProperty(“webdriver.chrome.driver”,”G:\\Lib\\chromedriver.exe”);

WebDriver driver = new ChromeDriver();

driver.navigate().to(“https://www.google.com”);

Internet Explorer

System.setProperty(“webdriver.ie.driver”,”G:\\Lib\\internetexplorerdriver.exe”);

WebDriver driver = new InternetExplorerDriver();

driver.navigate().to(“https://www.google.com”);

Launching the Web browser

driver.get (baseURL);

To launch a fresh web browser instance the get() method is called on the WebDriver instance. The string character sequence passed as a parameter into the get() method redirects the launched web browser instance to the URL that you specify as its parameter.

Comparison between Expected and Actual Values:

Comparison code simply uses a basic if-else structure to compare the actual condition with the expected one.

if (actualCondition.contentEquals (expectedCondition)) {

System.out.printIn(“Success”);

} else {

System.out.printIn(“Fail”);

}

Terminating a Browser Session:

The “close()” method is used to close the browser window.

driver.close();

The scripts can be saved and re-run at any time. Hope this blog helps you in writing your first of many selenium test scripts.

Muriel Fernandes

Muriel Fernandes

The post Guidelines for writing Selenium automation appeared first on Online Productivity Solutions Pvt. Ltd..

]]>
https://opspl.com/blog/guidelines-writing-selenium-automation/feed/ 0