How to integrate Sikuli in Gradle Project - selenium

I want to use sikuli in my gradle project. I added dependencie in my build.gradle (See below)
implementation group: 'com.sikulix', name: 'sikulixapi', version: '2.0.5'
I save the image i want to click in my gradle project and create a simple code
Sikuli Code
However, upon execution i encountered the error below. Seems like it didn't find the image. Do i miss any dependencies or jar file? Please help me. Thank You
Starting ChromeDriver 99.0.4844.51 (d537ec02474b5afe23684e7963d538896c63ac77-refs/branch-heads/4844#{#875}) on port 12469
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
Mar 22, 2022 10:04:05 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
Open demoguru
Path file found: P(C:\Users\shienna.an.a.calub\eclipse-workspace\Sikuli\ChooseFileBtn.PNG) S: 0.7
[Student [URL=http://demo.guru99.com/test/image_upload/index.php, Region=NA, ReleaseMonth=February 2022, Type of Testing=Regression, StepNo=1, TestScript=Launch Browser, TestScriptDescription=Launch Browser, TestStep=Chrome Browser is successfully launched, ActualResult=, ExpectedResult=, ExecutionTime=03-22-2022 at 10:04:11 CST, Status=Info], Student [URL=http://demo.guru99.com/test/image_upload/index.php, Region=NA, ReleaseMonth=February 2022, Type of Testing=Regression, StepNo=2, TestScript=Launch Browser, TestScriptDescription=Launch Browser, TestStep=Quit Browser, ActualResult=, ExpectedResult=, ExecutionTime=03-22-2022 at 10:04:23 CST, Status=Info]]
CSV file was created successfully !!!
FAILED: testclickChooseFileBtn_Sikuli
FindFailed: C:\Users\shienna.an.a.calub\eclipse-workspace\Sikuli\ChooseFileBtn.PNG: (135x38) in R[0,0 1280x720]#S(0)
Line 2291, in file Region.java
at org.sikuli.script.Region.find(Region.java:2291)
at PageFactory.SikuliExample.clickChooseFileBtn_Sikuli(SikuliExample.java:34)
at TestCases.testSikuliExample.testclickChooseFileBtn_Sikuli(testSikuliExample.java:76)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:598)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:824)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
at org.testng.TestRunner.privateRun(TestRunner.java:794)
at org.testng.TestRunner.run(TestRunner.java:596)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:377)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:371)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:332)
at org.testng.SuiteRunner.run(SuiteRunner.java:276)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1134)
at org.testng.TestNG.runSuites(TestNG.java:1063)
at org.testng.TestNG.run(TestNG.java:1031)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

Related

`NullPointerException` when trying to run no-op `LightCodeInsightFixtureTestCase` on IntelliJ Community built from source

I've tried to create a simple IDEA plugin and a test case for it based on this manual:
package com.example;
import com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase;
public class NoopTest extends LightCodeInsightFixtureTestCase {
public void testNothing() {
}
}
Then I create JUnit run configuration, make it run this class, point working directory to D:\idea-community\bin directory (see below) and set VM options as per the manual:
-ea -Xbootclasspath/p:../out/classes/production/boot -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -XX:MaxPermSize=320m -Didea.system.path=../test-system -Didea.home.path=../ -Didea.config.path=../test-config -Didea.test.group=ALL_EXCLUDE_DEFINED
Then I run the test in debug mode and get the following error:
CompositeException (2 nested):
------------------------------
[0]: java.lang.NullPointerException
at com.intellij.testFramework.IdeaTestUtil.createMockJdk(IdeaTestUtil.java:77)
at com.intellij.testFramework.IdeaTestUtil.getMockJdk(IdeaTestUtil.java:72)
at com.intellij.testFramework.IdeaTestUtil.getMockJdk17(IdeaTestUtil.java:85)
at com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase$1.getSdk(LightCodeInsightFixtureTestCase.java:60)
at com.intellij.testFramework.LightProjectDescriptor.lambda$createContentEntry$3(LightProjectDescriptor.java:135)
at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:143)
at com.intellij.testFramework.LightProjectDescriptor.createContentEntry(LightProjectDescriptor.java:134)
at com.intellij.testFramework.LightProjectDescriptor.lambda$setUpProject$0(LightProjectDescriptor.java:58)
at com.intellij.openapi.application.WriteAction.run(WriteAction.java:105)
at com.intellij.testFramework.LightProjectDescriptor.setUpProject(LightProjectDescriptor.java:52)
at com.intellij.testFramework.LightPlatformTestCase.initProject(LightPlatformTestCase.java:242)
at com.intellij.testFramework.LightPlatformTestCase.doSetup(LightPlatformTestCase.java:303)
at com.intellij.testFramework.fixtures.impl.LightIdeaTestFixtureImpl.setUp(LightIdeaTestFixtureImpl.java:37)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$setUp$24(CodeInsightTestFixtureImpl.java:1190)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:14)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:55)
at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.setUp(CodeInsightTestFixtureImpl.java:1189)
at com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase.setUp(LightCodeInsightFixtureTestCase.java:76)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:358)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:14)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$2.run(EdtTestUtil.kt:59)
at java.awt.event.InvocationEvent.dispatch$$$capture(InvocationEvent.java:301)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:361)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
[1]: java.lang.AssertionError: setUp() has not been called
at org.junit.Assert.fail(Assert.java:88)
at org.junit.Assert.assertTrue(Assert.java:41)
at com.intellij.testFramework.fixtures.impl.BaseFixture.tearDown(BaseFixture.java:48)
at com.intellij.testFramework.fixtures.impl.LightTempDirTestFixtureImpl.tearDown(LightTempDirTestFixtureImpl.java:64)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$null$32(CodeInsightTestFixtureImpl.java:1241)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:14)
at com.intellij.testFramework.EdtTestUtilKt.runInEdtAndWait(EdtTestUtil.kt:37)
at com.intellij.testFramework.EdtTestUtil$Companion.runInEdtAndWait(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil.runInEdtAndWait(EdtTestUtil.kt)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.lambda$tearDown$33(CodeInsightTestFixtureImpl.java:1241)
at com.intellij.testFramework.RunAll.collectExceptions(RunAll.java:60)
at com.intellij.testFramework.RunAll.run(RunAll.java:52)
at com.intellij.testFramework.fixtures.impl.CodeInsightTestFixtureImpl.tearDown(CodeInsightTestFixtureImpl.java:1247)
at com.intellij.testFramework.fixtures.LightCodeInsightFixtureTestCase.tearDown(LightCodeInsightFixtureTestCase.java:88)
at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:370)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:19)
at com.intellij.testFramework.EdtTestUtil$Companion$runInEdtAndWait$1.invoke(EdtTestUtil.kt:14)
at com.intellij.testFramework.EdtTestUtilKt$runInEdtAndWait$2.run(EdtTestUtil.kt:59)
at java.awt.event.InvocationEvent.dispatch$$$capture(InvocationEvent.java:301)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:361)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
My set-up:
IDEA Community, built locally by clicking "Build - Build project" after following the "Check Out And Build Community Edition" manual. Path to the source root is something like D:\idea-community\, so that there is D:\idea-community\getPlugins.bat. Git commit is ef98a0ccb.
IDEA successfully runs in debug mode.
This IDEA is added as an IntelliJ Platform Plugin SDK to my plugin project.
I successfully run IDEA from my plugin project, and even navigate the source code.
How do I fix the error when running the test and make it pass?
I was able to fix the problem by removing D:\idea-community\out\production\intellij.pycharm.community\META-INF\PyCharmCorePlugin.xml, but that feels like a cheat because that file gets recreated with every build.
After further investigation I found out that PlatformTestCase.doAutodetectPlatformPrefix() detects PyCharmCore instead of Idea and it looks like mock Java SDK (or whatever) is not loaded in that case, hence NullPointerException.
I've found some mentions of similar problems on JetBrains forums here (from 2009), here (from 2012) and there (from 2014). It looks like platform autodetection in tests is a recent thing (from 2015). Moreover, it looks like it overrides any -Didea.platform.prefix=Idea that I pass as JVM options, so I don't see any better solution.

Unable to create new remote session with chromedriver

I was previously using selenium-server-standalone-2.53.1 and chromedriver 2.22 and my acceptance was running perfectly. When I ran it today using this same version it started to fail throwing an Unable to create a new remote session error. Now after upgrading to selenium-server-standalone-3.0.1 and chromedriver-2.25, it's throwing almost the same error. I cant figure out why this is the case. I'm very new to Selenium and would very much appreciate any help.
After upgrade error
Nov 08, 2016 4:27:54 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Nov 08, 2016 4:27:54 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
Nov 08, 2016 4:27:54 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{browserName=chrome, version=, platform=ANY}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'xxx.yyy.com', ip: '172.19.10.212', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', java.version: '1.8.0_60'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:155)
at pet.furiend.website.selenium.test.acceptance.HomePageTest.setUp(HomePageTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
-----UPDATE-----
After making a change to the webdriver url, it seems like its starting but I get another error thrown now.
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Map
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:251)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:158)
at pet.furiend.website.selenium.test.acceptance.HomePageTest.setUp(HomePageTest.java:25)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
It will help a lot if you could let us know what is your Chrome Browser version as it affects significantly ChromeDriver compatibility. For example if you have accidentally updated to version 54 of Chrome Browser then it is likely that you need ChromeDriver 2.25 for it to work properly.
As long as you are saying that it was working with your previous setup; I'll put my money on your actual Chrome Browser (careful not chromeDriver) updating under your nose; hence causing the error. The whole combo:
Selenium Standalone
ChromeDriver
Chrome Browser
is really fragile upon change (personally I force my browsers NOT to update automatically for this reason). If you want to force Chrome Browser not to update at all, just go at the Chrome path and rename update folder to update_old (norm win path: C:\Program Files (x86)\Google\update). This will prohibit Chrome from any further automatic updates.
First of all, if I were you, I'll try the latest ChromeDriver which is v2.25 see if this fixes your issue. You can download from here latest ChromeDriver225
If this didn't fix your issue then try playing around with different versions of Chrome + ChromeDriver until you get it right. Selenium is less susceptible to change and version 3.0.1 should work with any combo for your needs. Have a look here to see which versions of ChromeDriver are compatible with which versions of Chrome Browser.ChromeDriver Downloads/Compatibility
I can confirm that latest Chrome Browser, ChromeDriver and Selenium work well together.
So try this combo here:
Chrome Browser 54.0.2840.87 (latest at the time of writing this post)
Chrome Driver 2.25
Selenium 3.0.1
Best of luck!
Update after op updated to latest version of ChromeDriver
Well as mentioned in my comment below here are my options which work 100% with the latest versions of Chrome (54.0), ChromeDriver (2.25) and Selenium (3.0.1).You can first try to comment all of your capabilities and run chrome with these options instead:
System.setProperty("webdriver.chrome.driver", "C:\\projects\\test\\chromedriver.exe");
ChromeOptions options = new ChromeOptions();
options.addArguments("test-type");
options.addArguments("--disable-extensions");
So you can activate the above with:
driver = new ChromeDriver(options);
Now regarding capabilities, I think the version one that you are using, does not get or convey a value. If you insist on using it (I find it pointless personally) you can specify a value like following and see if this works for you.
caps.setCapability("browser_version", "54.0.2840.87");
Now, you should have solved it by now, but if something went really really wrong and this actually obstructs you from work, then try this extremely stable combo:
Chrome (48.0.2564.97) from here
Chrome Driver (2.9) from here
Selenium 3.0.1
Hope you can solve it this time, let us know how you get on!
It seems that you are using OSX, is there is any chance that you are launching your tests with the terminal app ?
I was stuck with this error for a while and I managed to fix the issue by unchecking “Set locale environment variables on startup” checkbox in advanced terminal app settings.
Or try to launch your test with this prefix :
LC_NUMERIC=”en_US.UTF-8″ *the command to launch your tests*
I had the same issue on Chrome Browser 55.0.2883.87, Chrome Driver 2.27
Selenium 3.0.1, as author:
"org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session."
Previously Grid was working on Firefox 46.0.1, Selenium 2.52.0.
But I have switched places Node and Hub Url's for:
driver = new RemoteWebDriver(hubAddress.toURL(), capabilities);
and it worked for me.
I hope this will help someone.

Getting error when using functions in pentaho kettle

I am adding a formula in a transformation in kettle. In the properties of that formula, when I click on formula textfield, I get an error:
org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME=''] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source)
at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
at org.pentaho.libformula.ui.editor.LibFormulaEditor.<init>(LibFormulaEditor.java:198)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog$3.widgetSelected(FormulaDialog.java:219)
at org.pentaho.di.ui.core.widget.TableView.editText(TableView.java:1940)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1895)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1867)
at org.pentaho.di.ui.core.widget.TableView.editSelected(TableView.java:1326)
at org.pentaho.di.ui.core.widget.TableView.access$3000(TableView.java:107)
at org.pentaho.di.ui.core.widget.TableView$26.mouseDown(TableView.java:949)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog.open(FormulaDialog.java:282)
at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:136)
at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:7835)
at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:2749)
at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:705)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1221)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7044)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:8304)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:580)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
... 35 more
When I am checking /home/ron/.swt/lib/linux/ it has the file libswt-mozilla-gtk-3740.so
Kindly help me with the solution
There are several issues that can prevent this functionality to work.
The root cause is that Pentaho uses SWT functionality that requires one of two browsers that installed in the operating system. Refer to this faq (http://www.eclipse.org/swt/faq.php#browserlinux).
In my case, we must choose whether we want to use WebKitGTK (webkit) or Mozilla Firefox (mozilla) by adding a VM option to the java command line :
-Dorg.eclipse.swt.browser.DefaultType=mozilla
In my system, Ubuntu 14.04, the webkit browser causes an error in libsoup, so I need to set this to mozilla. For reference see https://bugs.launchpad.net/ubuntu-gnome/+bug/1163501 for libsoup error in Eclipse which also uses SWT, similar to Pentaho.
Then, we need mozilla firefox to be present in the system, and also the mozilla XUL runner library. Install firefox first :
apt-get install firefox
Install XUL runner 1.9.2 because 2.0.0 or later is said to be incompatible (see http://jira.pentaho.com/browse/PDI-8730).
wget http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/03/2012-03-02-03-32-11-mozilla-1.9.2/xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
tar -xjf xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
mv xulrunner /opt/xulrunner-1.9.2
Configure the xulrunner path using this VM option :
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2
We also need to configure LD_LIBRARY_PATH and MOZILLA_FIVE_HOME to point to the xulrunner :
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
The final setting in spoon.sh is :
(spoon.sh, about line 13)
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
(spoon.sh, about line 184)
if [ -z "$PENTAHO_DI_JAVA_OPTIONS" ]; then
PENTAHO_DI_JAVA_OPTIONS="-Xmx512m -XX:MaxPermSize=256m -Dorg.eclipse.swt.browser.DefaultType=mozilla -Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2"
fi
You can also fix this issue by replacing the SWT jar and SWT-GTK jar in Kettle's libswt folder.
Diethard Steiner described the simple process on his blog, using the JAR files from Eclipse:
http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
This way you don't have to mess with start script; but keep in mind that the change will be overwritten by an update, too.

Jenkins build failed on OSX

I am trying to build my project using Jenkins to deploy the artifacts to the nexus. I have a Jenkins setup on my macOSX.
below is the error, I am getting:
Parsing POMs
[maventest] $
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java
-Xmx512m -XX:MaxPermSize=128m -Dfile.encoding=UTF-8 -cp /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/usr/share/maven/boot/plexus-classworlds-2.4.jar
org.jvnet.hudson.maven3.agent.Maven3Main /usr/share/maven
/Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-2.26.jar
/Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar
59985
<===[JENKINS REMOTING CAPACITY]===>channel started
channel stopped
ERROR: Failed to parse POMs java.io.IOException: Remote call on
Channel to Maven
[/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java,
-Xmx512m, -XX:MaxPermSize=128m, -Dfile.encoding=UTF-8, -cp, /Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-agent-1.3.jar:/usr/share/maven/boot/plexus-classworlds-2.4.jar,
org.jvnet.hudson.maven3.agent.Maven3Main, /usr/share/maven,
/Users/Shared/Jenkins/Home/war/WEB-INF/lib/remoting-2.26.jar,
/Users/Shared/Jenkins/Home/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-1.3.jar,
59985] failed at hudson.remoting.Channel.call(Channel.java:727) at
hudson.maven.ProcessCache$MavenProcess.call(ProcessCache.java:156) at
hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:770)
at
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:586)
at hudson.model.Run.execute(Run.java:1593) at
hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:491) at
hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:247) Caused by:
java.lang.InternalError: Can't connect to window server - not enough
permissions. at java.lang.ClassLoader$NativeLibrary.load(Native
Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724) at
java.lang.Runtime.loadLibrary0(Runtime.java:823) at
java.lang.System.loadLibrary(System.java:1045) at
sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method) at
java.awt.Toolkit.loadLibraries(Toolkit.java:1605) at
java.awt.Toolkit.(Toolkit.java:1627) at
java.awt.Color.(Color.java:263) at
hudson.util.ColorPalette.(ColorPalette.java:39) at
hudson.model.BallColor.(BallColor.java:56) at
hudson.model.Result.(Result.java:51) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:171) at
com.sun.proxy.$Proxy8.(Unknown Source) at
sun.reflect.GeneratedSerializationConstructorAccessor41.newInstance(Unknown
Source) at
java.lang.reflect.Constructor.newInstance(Constructor.java:513) at
java.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:929) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1759)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at java.util.HashMap.readObject(HashMap.java:1030) 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
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:979)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at
java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1969)
at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1775)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1327)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:349)
at hudson.remoting.UserRequest.deserialize(UserRequest.java:182) at
hudson.remoting.UserRequest.perform(UserRequest.java:98) at
hudson.remoting.UserRequest.perform(UserRequest.java:48) at
hudson.remoting.Request$2.run(Request.java:326) at
hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680) Finished: FAILURE
I already tried the below solution but it didn't work:
http://jenkins-ci.361315.n4.nabble.com/JIRA-Created-HUDSON-5584-java-io-IOException-Remote-call-on-Channel-to-Maven-td1475049.html
Configurations I have:
MAVEN_OPTS:-Xmx1024m
-XX:MaxPermSize=128m
-Dfile.encoding=UTF-8
-Djava.awt.headless=true
output of ps -ef | grep java: /usr/bin/java -Djava.awt.headless=true -jar /Applications/Jenkins/jenkins.war
build command:clean deploy -DaltDeploymentRepository=central::default::http://<user>:<pwd>#<host>:<port>/nexus/content/groups/public/
The solution I used was to apply Java 7. What you want to do is add 1.7 to Jenkins. Following these steps I was able to successfully build my project:
Go to the Oracle Java page and downloaded the 1.7_51 jdk for Mac.
Opened the dmg and ran the executable.
On the Mac, this installs the JDK to /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/
In Jenkins, go to 'Manage Jenkins' > 'Configure System'
Under the JDK heading, click the button that says JDK Installations
Under Name type 'JDK 1.7.0_51'
For JAVA_HOME type '/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/'
Select Save
Go to your project and select Configure
You should now have a JDK drop down near the top of the page.
Select the JDK you just configured under 'Manage Jenkins'
Run the build
After doing this, my build successfully ran without the 'Can't connect to window server - not enough permissions error.'
This line looks curious:
hudson.model.Executor.run(Executor.java:247) Caused by: java.lang.InternalError:
Can't connect to window server - not enough permissions. at java.lang.ClassLoader
$NativeLibrary.load(Native Method)
I would start with a simpler project, and then add complexity from that point, for the reason of just testing to make sure your basic assumptions are correct.
You might need to set the JVM property : -Djava.awt.headless=true . By doing that you will disable the (most likely unnecessary) gui libraries that are trying to load.

Unable to execute selenium webdriver scripts in safari 5 Browser

I have downloaded the Apple Developer certificate and also configured the Safari Extension in my framework. Now, when I start executing the script, the Browser is launched, it is performing few actions and then it is throwing the following error.
(Note: I am using selenium-server-standalone-2.31.0.jar)
Mar 5, 2013 3:59:13 PM org.openqa.selenium.safari.SafariDriverServer start
INFO: Server started on port 5674
Mar 5, 2013 3:59:33 PM org.openqa.selenium.safari.SafariDriverChannelHandler$1 operationComplete
INFO: Connection opened
Mar 5, 2013 3:59:45 PM org.jboss.netty.channel.SimpleChannelUpstreamHandler
WARNING: EXCEPTION, please implement org.openqa.selenium.safari.SafariDriverChannelHandler.exceptionCaught() for proper handling.
java.io.IOException: An existing connection was forcibly closed by the remote host
at sun.nio.ch.SocketDispatcher.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(Unknown Source)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.read(Unknown Source)
at sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:59)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.processSelectedKeys(AbstractNioWorker.java:465)
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:332)
at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:35)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Mar 5, 2013 3:59:46 PM org.openqa.selenium.safari.SafariDriverServer stop
INFO: Stopping server
I encountered the same error after calling safariDriver.quit(). It turns out that SafariDriver didn't close the socket even though it knew that it was going to terminate. To fix the issue, I've adjusted the behavior of the QUIT command, and included the patch with my PR for another feature related to the Safari Driver: https://github.com/SeleniumHQ/selenium/pull/87.
The actual fix is quite straightforward, view it at https://github.com/Rob--W/selenium/commit/2b53d4b61.
Want to implement this fix yourself? Follow the following steps:
Install the pre-requisites (available for Linux, Mac and Windows):
Java Development Kit (JDK, not just the JRE)
Ruby
Git
Clone the Selenium repository:
git clone https://code.google.com/p/selenium/
Apply my commit.
At the root of the Selenium repository, run the following command:
./go selenium-server-standalone offline=true
(if you're using Windows, omit ./ :)
go selenium-server-standalone offline=true
Wait a while. The initial build takes several minutes, subsequent builds are done within a minute. The desired result is found in the following directory (relative to the repository's root):
build/java/server/src/org/openqa/grid/selenium/selenium-standalone.jar