Re: [Sikuli-driver] [Question #664776]: I need to generate HTML report using screenshot

2018-02-21 Thread Vishal singh
Question #664776 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664776

Vishal singh posted a new comment:
I am using Sikuli 1.1.1

HTMLTestRunner is bundled ?
I actually didnt understood this can you please explain in detail
or any short example
i would really appreciate the help

sorry if this is bothering you much

Thanks

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

___
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


[Sikuli-driver] [Question #664776]: I need to generate HTML report using screenshot

2018-02-21 Thread Vishal singh
New question #664776 on Sikuli:
https://answers.launchpad.net/sikuli/+question/664776

@ Raiman

Hi,
i need to generate html reports with screenshots
I looked into the question 250286 and i understood what i need to add to the 
code to take the screen shot

**i cant access this modified version link --
https://dl.dropboxusercontent.com/u/42895525/HTMLTestRunner.zip

i did this changes in my current HTMLTestRunner 
def addSuccess(self, test):
self.success_count += 1
TestResult.addSuccess(self, test)
output = self.complete_output()
self.result.append((0, test, output, ''))
if self.verbosity > 1:
sys.stderr.write('ok ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('.')

def addError(self, test, err):
self.error_count += 1
TestResult.addError(self, test, err)
_, _exc_str = self.errors[-1]
output = self.complete_output()
self.result.append((2, test, output, _exc_str, 
self.generateTestScreenshot(test)))
if self.verbosity > 1:
sys.stderr.write('E  ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('E')

def addFailure(self, test, err):
self.failure_count += 1
TestResult.addFailure(self, test, err)
_, _exc_str = self.failures[-1]
output = self.complete_output()
self.result.append((1, test, output, _exc_str, 
self.generateTestScreenshot(test)))
if self.verbosity > 1:
sys.stderr.write('F  ')
sys.stderr.write(str(test))
sys.stderr.write('\n')
else:
sys.stderr.write('F')

please tell me what to change in here:

class ImportProject(unittest.TestCase):

def setUp(self):
pass

def tearDown(self):
pass

def test1():
pass

def test2():
pass

suite = unittest.TestLoader().loadTestsFromTestCase(importProject)
outFile = open("report.html", "w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outFile, title='test report', 
description='test case description' )
runner.run(suite)

please tell me if i am doing something wrong

Thanks in advance

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

___
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


Re: [Sikuli-driver] [Question #664438]: Sikuli script fails when run on projector screen or on multiple desktops

2018-02-16 Thread Vishal singh
Question #664438 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664438

Status: Answered => Solved

Vishal singh confirmed that the question is solved:
Thanks RaiMan, that solved my question.

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

___
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


Re: [Sikuli-driver] [Question #664438]: Sikuli script fails when run on projector screen or on multiple desktops

2018-02-15 Thread Vishal singh
Question #664438 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/664438

Vishal singh posted a new comment:
1.  ft1.1: Traceback (most recent call last):
  File "C:\Tools\td5_gui_automation\Sikuli 
scripts\ImportProject.sikuli\ImportProject.py", line 35, in 
test_importButtonOnToolbar
wait("1516200019285.png", 5)
  File "C:\Tools\td5_gui_automation\Sikuli 
scripts\ImportProject.sikuli\ImportProject.py", line 35, in 
test_importButtonOnToolbar
wait("1516200019285.png", 5)
  File "C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\sikuli\Sikuli.py", 
line 65, in wait
return SCREEN.wait(target, timeout)
FindFailed: FindFailed: 1516200019285.png: (107x28) in S(0)[0,0 1920x1080] E:Y, 
T:3,0
  Line 2759, in file Region.java

I can see the image. The mouse goes half way to the screen and then
stops and the scripts exits

2. Test cases not executed means 
 As shown in the sample scripts it executes test case 1 and then it 
executes test case 4 and generates the reports for test case 2 and 3 it shows 
find failed error (same as above) in the reports


No i am not aware of the multi monitor setup and usages 
Can you please send me the link ?

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

___
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


[Sikuli-driver] [Question #664438]: Sikuli script fails when run on projector screen or on multiple desktops

2018-02-15 Thread Vishal singh
New question #664438 on Sikuli:
https://answers.launchpad.net/sikuli/+question/664438

Hi
I was researching about automation tool for GUI testing and i found sikuli
So i investigated about sikuli and found that it can be very useful  for my 
application for creating automation scripts

I installed sikuli and wrote some test scripts performing GUI tests on our 
applications just to show my team how sikuli works and that we can further 
develop scripts in sikuli

I wrote my script when my laptop was connected to a docking station and i had 
two desktops

The problem i faced
1.  When i ran the scripts on my laptop connected to projector the script 
failed due to an error
2.  When i ran my scripts again this time only on laptop only two test case was 
executed infact i had four test cases i dont why
3.  When again i connected my laptop to docking station only two test cases 
were executed it seems it skips the test cases in the middle and run only the 
first and the last one 

Can someone please help me out with this i need to give presentation to my team 
again by fixing this issues

Example Script

Class sikuli():
   def setUp(): 
pass
   def tearDown():
pass
   def test_1():
pass
   def test_2():
pass
   def test_3():
pass
   def test_4():
pass


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

___
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


Re: [Sikuli-driver] [Question #663899]: HTML reports shows pass even if the test Fails in Sikuli

2018-01-31 Thread Vishal singh
Question #663899 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663899

Status: Answered => Solved

Vishal singh confirmed that the question is solved:
Thank you so much for your help RaiMan 
I think i got it 
How to setup and how to use Unittest module 
Thanks once again

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

___
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


Re: [Sikuli-driver] [Question #663899]: HTML reports shows pass even if the test Fails in Sikuli

2018-01-31 Thread Vishal singh
Question #663899 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/663899

Vishal singh posted a new comment:
Thanks for the reply RaiMan
Can you show me an example like a code snippet what i am doing wrong exactly 
I want to create test report as well as test log what i am doing after each step

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

___
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


[Sikuli-driver] [Question #663899]: HTML reports shows pass even if the test Fails in Sikuli

2018-01-31 Thread Vishal singh
New question #663899 on Sikuli:
https://answers.launchpad.net/sikuli/+question/663899

Hi
I am new to sikuli and currently automating my Desktop application
I am writing a script to check if the image is present on the application or 
not and generating the HTML report
But the report always shows the tests pass even  if  i close the application to 
check if it shows fail or not

Please tell me how to solve this error 
Thank you in advance 

Here is the code:
import os
import HTMLTestRunner
import unittest
import sys
import logUtils
logger = 
logUtils.createLog(r'C:\Tools\td5_gui_automation\Test_logs\toolbar_test.log')

class Util(unittest.TestCase):

def setUp(self):
# setup the test environment needed to execute the tests in this 
function
try:
TD5 = os.popen(r"C:\Tools\TD5\start_td5_adas_net.lnk")
wait(30)
if exists("1516275912874.png"):
logger.info("TD5 started")
else:
logger.error('Unable to launch TD5')
except Exception, e:
str(e)
logger.error(e)

def tearDown(self):
# After completion of the tests tear down exits the application 
try:
if exists("1516275912874.png"):
click(Pattern("1517330159528.png").targetOffset(19,-29))

logger.info("Exiting TD5")
else:
logger.error('Unable to exit TD5')

except Exception:
print Exception

def test_newProjectButton(self):
try:
logger.info("Checking new project button on toolbar")
if exists("1516275912874.png"):

click(Pattern("1517328688615.png").similar(0.80).targetOffset(-9,1))
logger.info("Clicked on new button on toolbar")
wait(2)
if exists(Pattern("1517330266749.png").similar(0.90)):  
  
logger.info("New project dialogue successfully started")
click("1517330523887.png")
assert True
else:
logger.error("Unable to start New project import wizard")
assert False
else:
logger.error("Unable to click on new button in toolbar")

except Exception, e:
str(e)
logger.error(e)

suite = unittest.TestLoader().loadTestsFromTestCase(Util)
outFile = open(r"C:\Tools\td5_gui_automation\Test_reports\toolbar_test.html", 
"w")
runner = HTMLTestRunner.HTMLTestRunner(stream=outFile, title='test report', 
description='Testing all toolbar icons on TD5 GUI' )
runner.run(suite)


HTML report:
It shows pass in the report and when i click pass it shows me this

pt1.1: Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O operation on closed file
Logged from file ToolbarUtil.py, line 18
Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O operation on closed file
Logged from file ToolbarUtil.py, line 18
Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O operation on closed file
Logged from file ToolbarUtil.py, line 18
Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O operation on closed file
Logged from file ToolbarUtil.py, line 18
Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O operation on closed file
Logged from file ToolbarUtil.py, line 58
Traceback (most recent call last):
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
  File 
"C:\Tools\td5_gui_automation\SikuliX\sikulix.jar\Lib\logging\__init__.py", line 
874, in emit
stream.write(fs % msg)
ValueError: I/O