How to run Selenium tests in headless mode.

Quick, pace, speed are some synonyms which describes us. We , humans, wants pace in each and every act of ours. We want to speed up things as much as we can do. So we try experimenting things as in we try to search for betterment of work, as we are growing in automating things, replacing human acts to programs or machinery.

If I talk about selenium, then the major time which is spent in framework is at execution. And if I go one step more deeper then the initial point where the execution takes time is when it is trying to open browser be it Chrome, IE or any other. So just to wipe out this pain point there is one such browser which works in headless mode, and is compatible with selenium as well.

Read More »

How to deal with Internet Explorer issues to make it work via Selenium.

To err is human, well said.

I have been traversing over web what all new things I can explore and share knowledge about, but I can never deny the fact that there is a lot which I can share and talk about. Today I will share how Selenium faces problem  while connecting with Internet Explorer. Lets get started then.

How to use Internet Explorer?

Selenium provided support to Firefox, by default. This is something which the Selenium-creators have done to make our life easier while working with FireFox. Now, how about browsers other than default. Of-course, they understand that Web-UI testing can not be said as completed if it is not tested well on multiple browsers.

For testing your application on Internet Explorer via Selenium, you need to add the internetExplorer.exe into your project. And use this for the invocation of the browser,like this:
Read More »

at org.openqa.selenium.firefox.internal. NewProfileExtensionConnection.start

There are several phases in a tester’s life starting from working in a team to making automation framework. Along with this he/she has to make sure the integrity of the work-test life-cycle.

Today in this blog post I will share a problem which will come when people who has to work on a framework who was made by someone else and he/she has to maintain and extend it.
Read More »

Helium .. a boon or not to all automation engineers?

‘Selenium’ is the hot-topic in the automation sector, if any developer or tester knows Selenium well, then it is considered  as he can do anything which is required to perform ‘Web automation’. Its been almost a decade when Selenium came up to the market, and as the time passed it became more and more popular. People started taking it more seriously. Not only as a stand-alone tool, merely with the combination of other tools like Maven, Jenkins, TestNG, etc.

Though the work goes on, and people started taking more interest in this automation area, people started finding flaws in this tool. However some were very genuine, on contrary some seems to make less sense.
Read More »

Resolution of some major Errors/Exception which users face while working with Selenium Grid.

1. failed configuration: @beforemethod setup org.openqa.selenium.webdriverexception: error forwarding the new session empty pool of vm for setup capabilities.

Resolution : https://khyatisehgal.wordpress.com/2014/08/27/failed-configuration-beforemethod-setup-org-openqa-selenium-webdriverexception-error-forwarding-the-new-session-empty-pool-of-vm-for-setup-capabilities/

Read More »

Varied understanding of TestNg and Selenium grid on distinct lines.

Last week, I have given a session over Selenium grid with one of my colleague. 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.

Read More »

FAILED CONFIGURATION: @BeforeMethod setUp org.openqa.selenium. WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities


[TestNG] Running:
C:\Users\user\AppData\Local\Temp\testng-eclipse-2068414740\testng-customsuite.xml

FAILED CONFIGURATION: @BeforeMethod setUp
org.openqa.selenium.WebDriverException: Error forwarding the new session Empty pool of VM for setup Capabilities [{platform=WINDOWS, ensureCleanSession=true, browserName=internet explorer, version=}]
Command duration or timeout: 200 milliseconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '192.168.0.162', 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)

Read More »

Listening on port 32052:Exception in thread “main” org.openqa.selenium.remote. SessionNotFoundException

ERROR

Started InternetExplorerDriver server (32-bit)
2.42.0.0
Listening on port 32052
Exception in thread "main" org.openqa.selenium.remote.SessionNotFoundException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.21 seconds
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '192.168.14.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_67'

Read More »

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

ERROR

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: 'ksehgal', 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)

Read More »

java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1

java.lang.UnsupportedClassVersionError: com/xtr/parallel/QuickTestWinFF :Unsupported major.minor version 51.0 at
 java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at
 java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at
 java.net.URLClassLoader.access$000(URLClassLoader.java:58) at
 java.net.URLClassLoader$1.run(URLClassLoader.java:197) at java.security.AccessController.doPrivileged(Native
 Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
 java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
 org.testng.internal.ClassHelper.forName(ClassHelper.java:96) at
 org.testng.xml.XmlClass.loadClass(XmlClass.java:78) at org.testng.xml.XmlClass.init(XmlClass.java:73) at
 org.testng.xml.XmlClass.(XmlClass.java:59) at
 org.testng.xml.TestNGContentHandler.startElement(TestNGContentHandler.java:543) at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501) at
 com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:17
 9) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:788) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScanneImpl.java:1343) at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756) at
 com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647) at  com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at
 com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at
 com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at
 com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at
 com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at
 javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at javax.xml.parsers.SAXParser.parse(SAXParser.java:198) at
 org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:17) at
 org.testng.xml.SuiteXmlParser.parse(SuiteXmlParser.java:10) at org.testng.xml.Parser.parse(Parser.java:172) at
 org.testng.TestNG.initializeSuitesAndJarFile(TestNG.java:311) at
 org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:88) at
 org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at
 org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

Read More »

selenium grid: org.openqa.selenium.remote. UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.

Error:

[TestNG] Running:
C:\Users\user\AppData\Local\Temp\testng-eclipse-314942106\testng-customsuite.xml
FAILED CONFIGURATION: @BeforeClass setUp
org.openqa.selenium.remote.UnreachableBrowserException: Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:17:32'
System info: host: 'ksehgal', ip: '192.168.14.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.6.0_43'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:589)
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 blogExample.TestingBot.setUp(TestingBot.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:175)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:107)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:335)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:330)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:117)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:178)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:322)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:301)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:568)
... 28 more

Read More »