Sikuli script does not run on Linux - sikuli

My SikuliX script run on Windows10. However, under Linux (Debian 7.11), the script only opens my application and refuses to continue to execute the remaining script. I tried running on SikuliX versions 1.1.4 and 2.0.1.
Gives an error message:
“[Error] App.isRunning: '[ps, -p, -1]' Process exited with an error: 1
(Exit value: 1)”
Please tell me what is the matter here and is it possible to fix this error?
System Information:
Debian OS 7.11
/usr/local/share/OpenCV/java/libopencv_java320.so
/opt/opencv/opencv-3.2.0/build/lib/libopencv_java320.so
I have java -version installed:
openjdk version "11" 2018-09-25
OpenJDK Runtime Environment 18.9 (build 11+28)
OpenJDK 64-Bit Server VM 18.9 (build 11+28, mixed mode)
Here is my script:
uc = App("/opt/UniversalReader/UniversalReader-v3.9.22_x64")
uc.open()
if not uc.isRunning(10): # wait max 10 seconds
exit(1)
wait(0.3)
mTL = find("Iconuc.png") # find top left.
mBEx = find("PrimerBtn.png")
hover(mBEx.getCenter().click())
while not exists("Listofexamples.png"):
sleep(5)
click("findTestDatabtn.png")
for x in findAll("Closebtn.png"):
sleep(1)
click("Closebtn.png")
click("Closebtn.png")
click("Closebtn.png")
mClbtn = find("CloseBtnPanel.png")
click(mClbtn)
while not exists("WinClose.png"):
sleep(5)
click("NoBtn.png")
mExitBtn = mTL.nearby(1000).right().find("ExitBtn.png") # find top right
click(mExitBtn)
while not exists("WinExit.png"):
sleep(5)
click("NoBtn.png")

This is RaiMan from SikuliX - sorry for the delay (you already asked on Launchpad).
Apparently the feature App.isRunning() does not work on Linux as expected. So I take it as a bug.
You should wait for your app to be ready in another way.
You might e.g. check visually or by looking for a text on the screen.

Related

NS 2.35 segmentation fault (core dumped) when running MDART protocol

When I run MDART routing protocol tcl script in NS 2.35, it says:
When configured, ns found the right version of tclsh in /usr/bin/tclsh8.6
but it doesn't seem to be there anymore, so ns will fall back on running the first tclsh in your path. The wrong version of tclsh may break the test suites. Reconfigure and rebuild ns if this is a problem.
num_nodes is set 16
INITIALIZE THE LIST xListHead
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 179769313486231570814527423731704356798070567525844996598917476803157260780028538760589558632766878171540458953514382464234321326889464182768467546703537516986049910576551282076245490090389328944075868508455133942304583236903222948165808559332123348274797826204144723168738177180919299881250404026184124858368.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)
And the simulation end time supposely end at 205s but when run the animation, the simulation end at 8s. Why is that? Thanks
ns found the right version of tclsh in /usr/bin/tclsh8.6
but it doesn't seem to be there anymore
tcl8.6 : You are supposed to use the "ns-2.35 tcl8.5.10" : It doesn't change version or location. (Unless you move ns-allinone-2.35). The external tcl8.6 can change with e.g. an update. And later versions tend to be missing some files, e.g. in Debian / Ubuntu.
Example https://drive.google.com/file/d/0B7S255p3kFXNVVlxR0ZNRGVORjQ/view?usp=sharing
$ tar xvf ns-allinone-2.35_gcc5.tar.gz ## 2014 - 2017 update
$ cd ns-allinone-2.35/
$ export CC=gcc-4.8 CXX=g++-4.8 && ./install
Segmentation fault
MDART cannot be used with a contemporary OS. The latest that worked was an Ubuntu 18.04.4 updated 16 months ago. Please see my tests https://drive.google.com/drive/folders/1si2jA3lc-23lubVHb3tFbIAXfnhRfg5O?usp=sharing ..... CentOS 8 fails, Ubuntu 20.04 fails. Etc. "2021 OS" fails.
EDIT : Further tests revealed that an updated Ubuntu 18.04 failed : The latest Ubuntu version for MDART is 16.04 .
NOTE 1: The Ubuntu 16.04 nam package is corrupt. Please use https://drive.google.com/file/d/0B7S255p3kFXNdmxzSmRzaVRWb28/view?usp=sharing → nam_1.15-10-ubuntu14_amd64.deb
NOTE 2: The Ubuntu 16.04 ns command : sudo apt install ns2
NOTE 3: Building ns-allinone-2.35/ → Four cases of random Tk errors after the latest Ubuntu updates. Possible solutions: Use ns-allinone-2.35_2021.tar.xz https://drive.google.com/file/d/167cP7hPnJGiNL3rK4Mxnh_-0t7_S8FTL/view?usp=sharing with Tcl, Tk updated to version 8.5.17 .... And there are three options for extra gcc/g++ compilers to try out https://drive.google.com/drive/folders/1xVEATaYAwqvseBzYxKDzJoZ4-Hc_XOJm?usp=sharing
export CC=gcc447 CXX=g++447 && ./install ## can also be used with ns-allinone-2.35 version 2011
export CC=gcc48 CXX=g++48 && ./install
export CC=gcc54 CXX=g++54 && ./install
Simulation time : The setting is maximum time. Example : The setting set val(end) 1006.0 will run about 6 seconds and end the output text with : 1000 simulation seconds ....... Time is relative. ns2 was developed in the 90th when processors were very slow Pentium 1 / Pentium 2 . ... And different protocols behave different with simulation time.

Automated tests too slow on Jenkins

I'm running Selenium Webdrive tests on Jenkins (Debian 9 without GUI) using Chromedriver and xvfb, and they are extremely slow as compared to local execution. A click is done in 4 minutes comparing to 300 ~ 400 milliseconds on my local machine.
the details of the environment are as follows :
Jenkins (running on Debian 9 without GUI) + Xvfb
Chrome = 67.0.3396.99
Java.version: '1.8.0_171'
Chromedriver Version: 2.40.565383
Selenium-java = 3.13.0
(The test project is in java (maven) with the framework TestNg v6.14.3)
I tried also Firefox, it's not as long as Chrome but it's still long compared to local
Any ideas ?
Try these two ChromeOptions:
options.addArguments("--proxy-server='direct://'");
options.addArguments("--proxy-bypass-list=*");
I found it here :

Selenium Timedout Exception while running test cases from Jenkins

Am running a set of test cases from Jenkins. All the test cases are failing with org.openqa.selenium.TimedoutException on all the functions. I have tested the same code using eclipse in local and its executing fine. Please check on the below error and help on resolving this issue
Configurations:
Selenium- standalone - jar - 2.53
Chromedriver - 2.36
Chrome Browser - 65
testng jar = 6.8
Code Sample:
WebDriverWait wait = new WebDriverWait(driver, 1000);
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString())));
WebElement el = driver.findElement(By.xpath(ORCollection.get("BtnMDUEligibilityClick").toString()));
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", el);
WebElementClick(" ",ORCollection.get("BtnMDUEligibilityClick").toString());
Thread.sleep(10000);
Logs:
org.openqa.selenium.TimeoutException: Timed out after 40 seconds waiting for visibility of element located by By.xpath: //button[contains(#class,'js-submit')]
I have increased webdriver.wait value in code from 40 seconds to 1000 but still we are getting the same error as Timedout.
I assume that your XPath expressions are correct and you can manually open the browser on the Jenkins slave machine.
The issue could be connected with the lack of interactive desktop. This could happen if you have installed Jenkins on the slave machine as windows service. The recommended for Windows way to control a Windows slave is by using Launch slave agents via Java Web Start. More info here and here.

max size for a Tcl value (2147483647 bytes) exceeded

I am trying to execute a TCL script through Ubuntu console,
Example test script exeuction in Console
tcl Main.tcl -file xxxx -test xxxx | tee test.log
It was throwing an error message without executing my script max size for a Tcl value (2147483647 bytes) exceeded
My Machine TCL Version
% puts $tcl_version
8.6
My Machine TCL Platform
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine) = x86_64
tcl_platform(os) = Linux
tcl_platform(osVersion) = 3.13.0-32-generic
tcl_platform(pathSeparator) = :
tcl_platform(platform) = unix
tcl_platform(pointerSize) = 8
tcl_platform(threaded) = 1
tcl_platform(user) = vkosuri
tcl_platform(wordSize) = 8
But it was running fine with other Ubuntu machine without giving any error message
Other Machine TCL Version
% puts $tcl_version
8.4
Other Machine TCL Platform
% parray tcl_platform
tcl_platform(byteOrder) = littleEndian
tcl_platform(machine) = x86_64
tcl_platform(os) = Linux
tcl_platform(osVersion) = 2.6.28-19-generic
tcl_platform(platform) = unix
tcl_platform(threaded) = 1
tcl_platform(user) = vkosuri
tcl_platform(wordSize) = 8
Could someone explain what went wrong with my machine.
Thanks
Malli
That looks exactly like you might be hitting a limit on the size of memory block that can be allocated in one piece. The 2GB limit on 64-bit platforms is a long-standing bug (assigned to me!) that can't be fixed without utterly destroying the ABI, which is why it's not been fixed yet. When you hit the limit, Tcl fails. It doesn't always fail catastrophically — that depends partially on what sort of context it has for recovery at the C level at the point when the problem is hit — but it most certainly can just keel over.
Since this is a known issue, your best bet would be if you can find a workaround. Can you process your data a bit at a time instead of in one massive chunk? (We'd need to see more of your code to make specific suggestions, of course.)
The problem was freeTDS package on Ubuntu http://www.freetds.org/
1st Approach
The queries are working well with freeTDS == 0.63, but my Ubuntu has freeTDS 0.93, now i downgraded freeTDS 0.93 to 0.63, it is working fine.
freeTds 0.63 source
ftp://ftp.freetds.org/pub/freetds/old/0.63/freetds-0.63.tar.gz
Setting up SQL Server connection on my Ubuntu Box
Required libraries/programs
tclodbc >= v2.5.1
unixODBC >= v2.2.11
freeTDS == 0.63
Configuration
Edit /etc/odbcinst.ini and include the following section:
Description = SQL Server 2005
Driver Driver = /usr/lib/odbc/libtdsodbc.so
2nd Approach
Copy libtdsodbc.so to /usr/lib/odbc/
I have placed libtdsodbc.so in my Google drive, you can download
https://drive.google.com/open?id=0B_cUPwVRE2oUXzIzX0NNSG1VZ1E&authuser=0
Hope it will work.
Thanks
Malli

KCacheGrind Not Opening Anything on Fedora 17

So, I've tried everything I can do right now, not really getting anywhere with this, so I am turning to the guys on SO for some assistance.
System Details:
Fedora 17 x86_64
Intel® Pentium(R) Dual CPU E2160 # 1.80GHz × 2
1.9 GiB memory
KCacheGrind 0.7.1
KDE Platform Version 4.9.4
Procedure Details:
I get an XDEBUG log from the server or from a Chrome Ext called Xdebug Helper. And I run it, either directly from the icon or from a Shell Script I created.
#!/bin/bash
export $(dbus-launch)
kcachegrind
And I get an error "No Profile Data Loaded"
Any ideas?
SORRY: error reads "(No function selected)"
Forgive me. I am a n00b at Linux and KCacheGrind.
I used root. Fixed. Adding 10 or more characters.