Problem with sikuli when integrating it with selenium webdiver java

Asked by paridhi mittal

Hello

Below is the error I am facing when i am using sikuli- script jar with selenium webdriver versoion 2.37 eclipse on ubuntu 13.10
I tried all the possible way like in properties adding variable . But not getting this error. I want a solution for this as soon as possible.
java.lang.UnsatisfiedLinkError: org.sikuli.script.natives.VisionProxyJNI.new_FindInput__SWIG_0()J

It wil be great if u could help me.

Thanks, Regards
Paridhi Mittal

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

Revision history for this message
RaiMan (raimund-hocke) said :
#1

What system?
What Sikuli version?

Revision history for this message
RaiMan (raimund-hocke) said :
#2

Sorry, its Ubuntu.

So I think you have to build libVisionProxy.so using the downloadable Linux Supplemental

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#3

Hello RaiMan

Thanks for reply. I am using ubuntu system and I am using sikuli-script.jar no version is mentioned.
I have put this library in my lib folder of the project and I am running it with ant. I hav't installed sikuli-ide on my system, because by default it takes open jdk version 7 and i am using sun jdk 6 which creates problem for rest of my code.
When I am running it with ant I get this error in test.xml file of mine.
<error message =java.lang.UnsatisfiedLinkError: org.sikuli.script.natives.VisionProxyJNI.new_FindInput__SWIG_0()J<error/>
Now what to do to solve it , and how to give path in build.xml II amm not getting.

Thanks,Regards
Paridhi Mittal

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#5

RaiMan

Can you specify me the jar or .so file which we have to use or can send me. I have searched a lot but not clicked rt.
I am using this sikuli-script.jar ( https://www.assembla.com/code/plus/subversion/nodes/trunk/PlusLib/tools/Sikuli/sikuli-script.jar?rev=1952 ) ......

Regards
Paridhi

Revision history for this message
RaiMan (raimund-hocke) said :
#6
Revision history for this message
paridhi mittal (paridhi-mittal) said :
#7

Hello RaiMan

Which jar to download ??

Revision history for this message
RaiMan (raimund-hocke) said :
#8

--- You are running on Ubuntu and are using:
sikuli script from this link
https://www.assembla.com/code/plus/subversion/nodes/trunk/PlusLib/tools/Sikuli/sikuli-script.jar?rev=1952

This assembly is setup for use with Wiondows and hence cannot be used with Ububtu (wrong native stuff).

--- What is this? Please give the exact file name of the downloaded artefact.
sikuli supplement
https://launchpad.net/sikuli/+download
.........8th from the top( Sikuli-X-1.0rc3 (r905)-linux-x86_64.zip (md5, sig)

You have to decide wether you want to work with Sikuli-X-1.0rc3 or SikuliX version 1.0.1.

In both cases the starting point is:
http://www.sikuli.org/download.html

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#9

Hello I am working on sikuli for the first time so don't have much knowledge regarding it. I want to run flex apps that all whether thats all.
Please can you tell me which specific jar should I use ?

Revision history for this message
RaiMan (raimund-hocke) said :
#10

Wether you are new or not, if you want to use Sikuli:

In any case the starting point is:
http://www.sikuli.org/download.html

Come back if you have specific questions regarding one of the steps in the above approach.

Since you are using Sikuli the first time, I recommend, to use version 1.0.1, so follow the steps for this version.

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#11

Hello RaiMan

The link which you have mentioned above I following it. Some queries are there can you guide me on it ?
I have installed sikuli setup on system after installing I get a folder in downloads which contains :
jdk1.6.0_38
libs folder that contains 3 .so files
runScript
sikuli-script.jar
SikuliX-1.0.1-SetupLog.txt
Now I am not getting how to use it in my project whether I should make a folder in my project and should keep above mentioned folder and script in itt and should linkk with my build or how ? confused.

Revision history for this message
RaiMan (raimund-hocke) said :
#12

You should put setup in a separate folder and run it in there.

Since you are working with Java, you should select option 4 from setup, which creates sikuli-java.jar.

usage with Eclipse:
https://github.com/RaiMan/SikuliX-API/wiki/Usage-in-Java-programming

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#13

I followed your link ..It helped to to solve problem of missing native library error. I selected option 4 from setup the libs folder which contains .so files , I made a folder in eclipse and placed it there and sikuli-java.jar i placed in my lib folder of my project is this fine approach ??
Though II have managed too solve native lib issue but now am facing
can not find Bracelet-Builder/StartBuildingNow.png on the screen." type="org.sikuli.script.FindFailed
this error.
My code is
public class CharmWorksBraceletBuilderTest{
  private WebDriver driver;
  public Screen s = new Screen();
@Test
public void setUp() throws Exception {
  driver = new FirefoxDriver();
  driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  testUntitled();
}
public void testUntitled() throws Exception {
 driver.get("https://www.thecharmworks.com");
 WebDriverWait wait = new WebDriverWait(driver, 30);
 WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.xpath("html/body/div[4]/footer/div[1]/div/div[2]/a/img")));
 element.click();
 driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
 s.click("abc.png", 0);
  }
How to get over this issue ??

Regards
Paridhi Mittal

Revision history for this message
RaiMan (raimund-hocke) said :
#15

Ok, it seems, that Sikuli is working now.

You problem is daily life with Sikuli:
Sikuli did not find the given image within the standard waiting time of 3 seconds on the screen.

the only place, in your code, where this could have happened is here

 element.click();
 driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
 s.click("abc.png", 0); // here it crashes

... though it should read ;-)
 s.click("Bracelet-Builder/StartBuildingNow.png", 0);

The easiest trick to give Sikuli more time to wait for the image:
 s.click(s.wait("Bracelet-Builder/StartBuildingNow.png",10.0), 0);

where the 10 stands for the max waiting time in seconds for this specific search.

If you think, that the image is on the screen, though Sikuli complains not found, then you have to check your image.

It might make sense, that you scan through the docs at http://doc.sikuli.org (at least the Region section) to get a feeling for some basic features of Sikuli.

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#16

Thanks For help RaiMan ...Issue not solved. Same error images not found.

Revision history for this message
RaiMan (raimund-hocke) said :
#17

if you like, you can send me all the stuff zipped together silently to my mail at https://launchpad.net/~raimund-hocke:
- the java program
- the images you use for searching
- a screenshot at the time of crash ( after the element.click(); driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);)

Without this I cannot help you further.

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#18

Let me give one more try if it dint worked ill mail u.. Before that can u check this link www.thecharmworks.com ?
On the main page you can see Bracelet Builder I am using sikuli for that. When you click on bracelet builder there comes a dialog box not sure what it is but kind of it written Bracelet builder. I think that is what is the main reason for error.. Becoz it keeps on loading and the testcase finds the next image when that image is not found it gives the error can not find Bracelet-Builder/StartBuildingNow.png on the screen." type="org.sikuli.script.FindFailed"
can u let what can be done for it ??
public void testUntitled() throws Exception {
 driver.get("https://www.thecharmworks.com");
        driver.findElement(By.linkText("Bracelet Builder")).click();
 driver.manage().timeouts().implicitlyWait(100, TimeUnit.SECONDS);
        s.doubleClick(s.wait("Bracelet-Builder/StartBuildingNow.png",10.0), 0);

Thanks
Paridhi

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#19

I have mailed you on mail-id <email address hidden>

Thanks
Paridhi

Revision history for this message
RaiMan (raimund-hocke) said :
#20

I got your mail and found, that the image is found, if it is visible on the screen.

driver.findElement(By.linkText("Bracelet Builder")).click();

activates the loading of a Flash web app. That you get a popup, might have something to do with the settings of the browser you are using.

Using standard GoogleChrome on my Mac (in Safari I have a flash blocker active), it works with no problems.

I have send you the zipped charms.sikuli, that worked for me. (the highlight does not work on Linux)

recommendation: before baking anything into Java, you should use the Sikuli IDE, for testing and image capturing.

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#21

RaiMan Hie. The flex app starts after clicking it on Bracelet Builder, When after clicking loading starts.. As I mentioned above ..

Revision history for this message
RaiMan (raimund-hocke) said :
#22

??? what do you want to tell me???

I fully understand and my answer is in comment #20

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#23

Yes I know u got the answer. And I am highly impressed RaiMan. What am I trying to tell and figure out is after clicking Bracelet Builder when loading occurs before click on start building now , error is thrown. I am using firefox version 22 in ubuntu ..What can I do as u have installed flash blocker ??
This is what I meant to say..

Revision history for this message
RaiMan (raimund-hocke) said :
#24

Sorry, but with this problem I have to leave you alone - not a Sikuli problem.

generally:
When using Sikuli (or Selenium), you have to implement a workflow, that simulates what you would do manually.
If there are popups or errors, you have to detect and handle them.

Revision history for this message
paridhi mittal (paridhi-mittal) said :
#25

No problem thanks for help..

Regards
Paridhi

Revision history for this message
RaiMan (raimund-hocke) said :
#26