New question #696483 on SikuliX:
https://answers.launchpad.net/sikuli/+question/696483

Hi,

Basically, we have a set of Sikuli scripts we created on a Windows server VM 
(Machine 1) and they work fine and are even integrated with a CI tool.

However, we want to run them against different versions of the software so 
copied these scripts (including all dependencies) to another VM (Machine 2) and 
ensured the JAVA version and other settings are exactly the same. 

But we keep getting the following error - only get this error the first time 
trying to execute the script (usually comes up with the top log4j errors – 
sometimes longer error as below). For subsequent executions, it just skips the 
whole script and displays SOT and EOT (see script further below).
 
I'm assuming it's some sort of a configuration issue. Where are these log4j 
settings?
Have added an example of the scripts further below. It would be really great if 
you could point us in the right direction.

Thanks
Ishtiaq


ERROR

Storm Filtering
log4j:WARN No appenders could be found for logger 
(org.python.netty.util.internal.logging.InternalLoggerFactory).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more 
info.
[info] Exit code: 0
SOT: SF_003
EOT: SF_003
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
               at 
java.desktop/javax.swing.text.FlowView$FlowStrategy.layoutRow(FlowView.java:576)
               at 
java.desktop/javax.swing.text.FlowView$FlowStrategy.layout(FlowView.java:489)
               at 
java.desktop/javax.swing.text.FlowView.layout(FlowView.java:209)
               at 
java.desktop/javax.swing.text.html.LineView.layout(LineView.java:123)
               at 
java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
               at 
java.desktop/javax.swing.text.BoxView.updateChildSizes(BoxView.java:367)
               at 
java.desktop/javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:349)
               at java.desktop/javax.swing.text.BoxView.layout(BoxView.java:709)
               at 
java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
               at 
java.desktop/javax.swing.text.BoxView.updateChildSizes(BoxView.java:367)
               at 
java.desktop/javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:349)
               at java.desktop/javax.swing.text.BoxView.layout(BoxView.java:709)
               at java.desktop/javax.swing.text.BoxView.setSize(BoxView.j
ava:398)
               at 
java.desktop/javax.swing.text.BoxView.updateChildSizes(BoxView.java:367)
               at 
java.desktop/javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:349)
               at java.desktop/javax.swing.text.BoxView.layout(BoxView.java:709)
               at 
java.desktop/javax.swing.text.BoxView.setSize(BoxView.java:398)
               at 
java.desktop/javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1821)
               at 
java.desktop/javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1111)
               at 
java.desktop/javax.swing.plaf.basic.BasicTextUI.modelToView(BasicTextUI.java:1089)
               at 
java.desktop/javax.swing.text.DefaultCaret.repaintNewCaret(DefaultCaret.java:1318)
               at 
java.desktop/javax.swing.text.DefaultCaret$1.run(DefaultCaret.java:1296)
               at 
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
               at 
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
               at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
               at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)

               at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
               at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
               at 
java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
               at 
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
               at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
               at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
               at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
               at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
               at 
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)



SCRIPT

# 
--------------------------------------------------------------------------------------------------------------
# Test Description: SF_003 - Storm Filtering Mimic Test
#
# Minimum target:
# Maximum target:
# Server instance:
# 
--------------------------------------------------------------------------------------------------------------

# Script Name
print "Storm Filtering"

import org.sikuli.script.SikulixForJython
from sikuli import *

addImportPath("C:\\Sikuli\\Aveva")
addImportPath("C:\\Sikuli\\Dependancies")

addImagePath("C:\\Sikuli\\SE\\SF_003.sikuli")
addImagePath("C:\\Sikuli\\SE\\SECommon.sikuli")
addImagePath("C:\\Sikuli\\Aveva\\CommonViewX.sikuli")
addImagePath("C:\\Sikuli\\Aveva\\Common.sikuli")
addImagePath("C:\\Sikuli\\Aveva\\CommonObject.sikuli")

import CommonViewX
import Common
import CommonObject
import SECommon
import XMLTestRunner1
import unittest

Settings.ActionLogs = True
Settings.UserLogs = True
Settings.UserLogPrefix = "test"
Settings.UserLogTime = True

# 
--------------------------------------------------------------------------------------------------------------
# Test Body
# 
--------------------------------------------------------------------------------------------------------------

class SF_003(unittest.TestCase):
    
    def setUp(self):
        
        # Launch ViewX
        if CommonViewX.LaunchViewX("", "", ""):
            Debug.user("PASS - 001 - ViewX launched")

        # Logon to ViewX
        if CommonViewX.ViewXLogOnAsUser("Ribbon", "DevOpsTest", "DevOpsTest"):
            Debug.user("PASS - 002 - Logged on to ViewX")

         # Navigate to test Group
        CommonViewX.ExpandMainRootNode()
        
CommonViewX.ExpandGroup([Pattern("1587657354043.png").targetOffset(2,2)])
        CommonViewX.ExpandGroup(["1584463258669.png"])
        CommonViewX.ExpandGroup(["1584463284474.png"])
        Debug.user("PASS - 003 - Expanded all required Groups")       
        
        assert True
        
        
    def test(self):
        
        CommonObject.DisplayMimic([Pattern("1587722496992.png").similar(0.90)], 
[Pattern("1587725756104.png").similar(0.80)], 
[Pattern("1587725756104.png").similar(0.80)])   
        if Common.Exists(["1584545459195.png"], documentRegion, 3):
            Debug.user("PASS - 004 - Storm Filtering mimic displayed correctly")
        else:
            Common.EndTestOnFailure("004 - Storm Filtering mimic not displayed 
correctly")
      
        Common.Click(["1584547358411.png"], "", 1)
        Common.Wait(["1584017291569.png"], "", 30)
        Common.Click([Pattern("1584017446172.png").targetOffset(-49,4)], "", 1)
        Common.Wait(["1584019307201.png"], "", 5)
        Common.Click([Pattern("1584019307201.png").targetOffset(113,78)], "", 
5)      
        CommonViewX.ExpandGroup(["1584547435611.png"])
        CommonViewX.ExpandGroup(["1588237843971.png"])
        Common.RightClick(["1584547498755.png"], "", 3)
        Common.Click([Pattern("1584547591388.png").targetOffset(-36,28)], "", 
3)      
        
        if Common.Exists(["1584373848888.png"], "", 1):
            Debug.user("PASS - 005 - MAOIPoints data displayed")
        else:
            Common.EndTestOnFailure("005 - MAOIPoints data not displayed")
            
            
        CommonViewX.ExpandGroup([Pattern("1588258767279.png").similar(0.79)])
        Common.Wheel([Pattern("1588258767279.png").similar(0.79)],"DOWN",5, "")
        
Common.DoubleClick([Pattern("1588258836604.png").similar(0.98).targetOffset(1,2)],
 "", 1)
        
Common.DoubleClick([Pattern("1588259120860.png").similar(0.90).targetOffset(5,2)],
 "", 1)

        Common.Wheel(["1584549953739.png"],"DOWN", 5, "")

        if Common.Exists(["1584449758274.png"], "", 1):
            Debug.user("PASS - 006 - Area of Interest STORM displayed")
        else:
            Common.EndTestOnFailure("006 - Area of Interest STORM not 
displayed")


        Common.Click(["1584548432653.png"], "", 1)
        Common.Click(["1584548457616.png"], "", 1)
        Common.Wait([Pattern("1584548513452.png").targetOffset(-22,1)], "", 30)
        Common.Click([Pattern("1584548513452.png").targetOffset(80,63)], "", 1)
        Common.Wait(["1584548611022.png"], "", 20)
        Common.Click(["1584550826497.png"], "", 1)
        Common.Click([Pattern("1584551913342.png").targetOffset(27,0)], "", 1)
        Common.DoubleClick([Pattern("1584552167179.png").targetOffset(-5,-6)], 
"", 1)
        wheel("1584549953739.png",Button.WHEEL_DOWN, 5)
        if Common.Exists(["1584551044796.png"], "", 1):
            Debug.user("PASS - 007 - Area of Interest IPHORV displayed")
        else:
            Common.EndTestOnFailure("007 - Area of Interest IPHORV not 
displayed")

        assert True


    def tearDown(self):
        
        # Close ViewX
        if CommonViewX.CloseViewX("Direct"):
            Debug.user("PASS - 008 - ViewX closed")
            
        assert True

    
# 
--------------------------------------------------------------------------------------------------------------
# Test Execution
# 
--------------------------------------------------------------------------------------------------------------

if __name__ == "__main__":

    print("SOT: SF_003")
    
    documentRegion = CommonObject.GetDocumentRegion()
    
    suite = 
unittest.TestSuite(unittest.TestLoader().loadTestsFromTestCase(SF_003))
    
    xmlFile = os.path.join(getBundlePath(), "Results.xml")
    result = XMLTestRunner1.XMLTestRunner(file(xmlFile, "w")).run(suite)
    
    print("EOT: SF_003")
    
    exit(0)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for SikuliX.

_______________________________________________
Mailing list: https://launchpad.net/~sikuli-driver
Post to     : sikuli-driver@lists.launchpad.net
Unsubscribe : https://launchpad.net/~sikuli-driver
More help   : https://help.launchpad.net/ListHelp

Reply via email to