Newman integration with Postman

A postman is a tool that helped a lot of software engineers in testing APIs.

We can actually send the collections to marketing people & clients also. There is a lot we have evolved in this tool. Today I am going to show how I integrated Newman with the postman in one of my existing collections.

Lets get started

  • ​​ First you need to create a folder in your operating system.
  • Put your postman collection here – by Exporting the project from the postman.                       
Export in postman
Continue reading “Newman integration with Postman”

ERROR @wdio/sync: TypeError: hook.apply is not a function at execHook

Problem

hook.apply is not a function at execHook (/Users/khyati.sehgal/Documents/workspace/web-app/e2e/node_modules/@wdio/sync/build/executeHooksWithArgs.js:21:31) [0-0] 2021-02-02T02:58:31.052Z

ERROR @wdio/sync: TypeError: hook.apply is not a function at execHook

Continue reading “ERROR @wdio/sync: TypeError: hook.apply is not a function at execHook”

Automating react application

Nowadays we all moving towards frameworks like Angular, react Js, Vue JS, etc.

So for Quality teams we have also started looking for options which support scripting language. But before starting any new things a wise approach is to understand the requirement & then look for suitable solution which full-fill it.

Options I considered

  1. Protractor
  2. Jest
  3. Nightwatch JS
  4. Cypress
  5. webdriver JS
  6. selenium
Continue reading “Automating react application”

FAILED: test org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {“code”:-32603,”message”:”Cannot navigate to invalid URL”}

FAILED: test
org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {"code":-32603,"message":"Cannot navigate to invalid URL"}
(Session info: chrome=49.0.2623.105)
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 6.1 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 180 milliseconds
Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40'
System info: host: 'HSNMM-KhyatiS', ip: '10.50.33.63', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_79'
Session ID: 805809dc0b6156ce969fb10e0e95c2a5
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities [{platform=ANDROID, acceptSslCerts=true, javascriptEnabled=true, browserName=chrome, chrome={}, rotatable=false, locationContextEnabled=true, mobileEmulationEnabled=false, version=49.0.2623.105, takesHeapSnapshot=true, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false, webStorageEnabled=true, nativeEvents=true, hasTouchScreen=true, applicationCacheEnabled=false, takesScreenshot=true}]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)

Continue reading “FAILED: test org.openqa.selenium.WebDriverException: unknown error: unhandled inspector error: {“code”:-32603,”message”:”Cannot navigate to invalid URL”}”

Setting loggers in Selenium with log4j

Setting loggers in Selenium with log4j

Imports to make

import java.io.File;
import java.io.IOException;
import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.RollingFileAppender;
Continue reading “Setting loggers in Selenium with log4j”

How to take screenshots via Selenium.

If we have to prove something to either a developer or a Product owner then we generally we have several ways via which we can actually show the idea to them, but what if whatever you want to show stop working when you actually want to demo it? This is silly, right? But it happens, You have to believe me!!
Continue reading “How to take screenshots via Selenium.”

Part II – One step deeper into Page Object Model.

As we have already discussed in my last post on page object model, why we need design patterns while coding. In this post, lets see what all pre-requisites are required to get a quick start so that we can get a better understanding of POM aka Page Object Model:

  1. The functionality classes (PageObjects) represent a reasoned common lineage between the pages of the application.
  2. The Page Object pattern act for the screens of your web app as a sequence of objects.
  3. It encapsulates the characteristics represented by a page.
  4. It permit us to mock-up the UI in our tests.
  5. A page object is an object-oriented class that work as an interface to a page of your AUT.
Continue reading “Part II – One step deeper into Page Object Model.”

Varied understanding of TestNg and Selenium grid on distinct lines.

Last week, I have given a session over the Selenium grid with one of my colleagues. In that session, we have covered various topic related to Selenium grid, and we answered some great questions which were asked from the audience out there. In this blog post, I will share the most relish topic which is TestNG.

I have seen many articles, notes, etc over the comparison of TestNG and Selenium Grid, and in this piece of write-up I will share my own experience of working with both and what all pros-cons both holds.To start with let us start with Selenium grid.

Selenium Grid

It is one of the flavor of widely used web automation tool – Selenium. Selenium comes in different edition, like Selenium IDE, Selenium Remote Control, Selenium Webdriver, and Selenium Grid. Each one has its own unique importance.

Continue reading “Varied understanding of TestNg and Selenium grid on distinct lines.”

Exception in thread “main” org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

Exception in thread “main” org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

In this blog post, I will share the resolution of an issue which is very general and often seen by Selenium developers.

Continue reading “Exception in thread “main” org.openqa.selenium.WebDriverException: f.QueryInterface is not a function”

Selenium Grid: Forbidden for Proxy, HTTP ERROR: 403

Selenium Grid : Forbidden for Proxy , HTTP ERROR: 403

Command to start Selenium Grid at your local

java -jar selenium-server-standalone-2.41.0.jar

Aug 20, 2014 7:44:34 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
2014-08-20 19:44:35.907:INFO:osjs.Server:jetty-7.x.y-SNAPSHOT

2014-08-20 19:44:35.952:INFO:osjsh.ContextHandler:started o.s.j.s.ServletContextHandler{/,null}
2014-08-20 19:44:35.960:INFO:osjs.AbstractConnector:Started SocketConnector@0.0.0.0:4444
Continue reading “Selenium Grid: Forbidden for Proxy, HTTP ERROR: 403”

org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]

Problem Statement


Exception in thread "main" org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]
Command duration or timeout: 198 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'XXXX', ip: '192.168.14.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
 at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:193)
 at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
 at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:595)
 at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:240)
 at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:126)
 at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:153)
 at remoteDriver.TestFireFoxRemotely.main(TestFireFoxRemotely.java:17)

Caused by: org.openqa.grid.common.exception.GridException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]
 at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:114)
 at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
 at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:67)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
 at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
 at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
 at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
 at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
 at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
 at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
 at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
 at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
 at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
 at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
 at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
 at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
 at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
 at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
 at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
 at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
 at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
 at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
 at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
 at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
 at java.lang.Thread.run(Thread.java:745)


Code used

Continue reading “org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{browserName=safari}]”

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 17 milliseconds
Build info: version: ‘2.41.0’, revision: ‘3192d8a6c4449dc285928ba024779344f5423c58’, time: ‘2014-03-27 11:29:39’
System info: host: ‘ksehgal’, ip: ‘192.168.0.95’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.6.0_43’
Session ID: b469c4b9-7596-4b66-b87e-646db4256726
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=29.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]

org.openqa.selenium.WebDriverException: f.QueryInterface is not a function
Command duration or timeout: 17 milliseconds
Build info: version: '2.41.0', revision: '3192d8a6c4449dc285928ba024779344f5423c58', time: '2014-03-27 11:29:39'
System info: host: 'ksehgal', ip: '192.168.0.95', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43'
Session ID: b469c4b9-7596-4b66-b87e-646db4256726
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=XP, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=29.0.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]
Continue reading “org.openqa.selenium.WebDriverException: f.QueryInterface is not a function”

Selenium Builder – Exporting and execution

In continuation of my last blog, I will here share a more advanced capability of Selenium Builder.
Now as we are done with the set up we can talk one step ahead. Let’s start with an example :
I have opened a website in firefox and I want to automate some actions on this page. Let’s say :

 I want to open the URL (https://khyatisehgal.wordpress.com/).
I need to check a blog on this website, the very first one.
I want to see the author’s about my column.

In continuation of my last blog, I will here share a more advanced capability of Selenium Builder.
Now as we are done with the set up we can talk one step ahead. Let’s start with an example :
I have opened a website in firefox and I want to automate some actions on this page. Let’s say :

  1.  I want to open the URL (https://khyatisehgal.wordpress.com/).
  2. I need to check a blog on this website, the very first one.
  3. I want to see the author’s about my column.

And that’s all.

What I will do for this is,

  1. open the firefox
  2. launch the Selenium Builder.
  3. start doing the above steps.

Continue reading “Selenium Builder – Exporting and execution”

My First Selenium – Java Project in eclipse.

Today I will be sharing how to start making a new selenium project. I will start with some basic requirements and then will be proceeding to the art of making selenium test scripts.

Today I will be sharing how to start making a new selenium project. I will start with some basic requirements and then will be proceeding to the art of making selenium test scripts.

Pre-requisite:

  1. Basic knowledge of a programming language like Java, C, Ruby, etc. See the link to learn Java.
  2. Basic knowledge of the Selenium tool.
  3. Art of finding locators.
  4. Set up of eclipse on the operating system you are using.

Java set up on your computer machine, in case you are using Java.

Continue reading “My First Selenium – Java Project in eclipse.”

Selenium components and their architectural differences.

I have seen many people asking a repetitive question in interviews if they see Selenium written on any Curriculum Vitae of a Test Engineer. Though I believe theoretical and conceptual knowledge is equally important as hand-on experience.
As a part of the hiring panel, I have observed this as a pet question of our hiring team: ‘How about the architectural difference between Selenium versions.’ Of course, once they are done with questions like ‘What you know all about selenium’ ?

I have seen many people asking a repetitive question in interviews if they see Selenium written on any Curriculum Vitae of a Test Engineer. Though I believe theoretical and conceptual knowledge is equally important as hand-on experience.

As a part of the hiring panel, I have observed this as a pet question of our hiring team: ‘How about the architectural difference between Selenium versions.’ Of course, once they are done with questions like ‘What you know all about selenium’ ?

Selenium generally comes in four different flavors:

  • Selenium IDE,
  • Selenium RC,
  • Selenium Grid and
  • Selenium Webdriver.

I will be sharing the best answer I got and the research which I did so as to understand the architecture of selenium.

Continue reading “Selenium components and their architectural differences.”