cancel
Showing results for 
Search instead for 
Did you mean: 

Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Highlighted
Contributor

Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Hello,

 

Can anyone tell me why the image is not getting highlighted on Jenkins whereas it is working fine on development environment. 

function testfunc()
{
  Delay(1000)
    /// Launching latest version of teststand designer application
    var TestStandD = Aliases.TestStandDesigner
    //if(TestStandD.Exists) { TestStandD.Close(); TestStandD.Terminate() }
     
    var TestStandDCtrl = Aliases.TeststandDesignerCtrl
    //if (TestStandDCtrl.Exists) { TestStandDCtrl.Close();  TestStandDCtrl.Terminate() }
    var path = Project.Path
    Log.Message(path)
    //var StrApplName = "C:\\KBData\\TSD\\TeststandDesigner\\Lib\\Assembly\\TeststandDesignerCtrl.exe"
    var StrApplName = path+"..\\..\\..\\TestStandDesigner\\Lib\\Assembly\\TeststandDesignerCtrl.exe"
    Log.Message(StrApplName)
    TestedAppIndex= TestedApps.Add(StrApplName)
    TestedApps.Items(TestedAppIndex)
    TestedApps.Items(TestedAppIndex).Run() 
    var titleBar=Aliases.TestStandDesigner.HwndSource_ShellView
    Mainform = TestStandD.WaitAliasChild("HwndSource_ShellView",50000)
    titleBar.SetFocus()
    titleBar.Activate()
    titleBar.Maximize()   
    Log.Message("Teststand Designer Application Launched")
    Delay(1000)
    
    //Open Project file
    var driveraddteststand = DDT.ExcelDriver(path+"\\TestData\\PrjData.xlsx","OpenFile",true)
    while(!driveraddteststand.EOF())
    { 
       var menupanel = TestStandD.FindChild(Array("ClrClassName","ClrFullClassName"),Array("Menu","System.Windows.Controls.Menu"),100)
       menupanel.WPFMenu.Click("Project|Open")
       OF = TestStandD.WaitWindow("#32770","Open Project File",1,10000)
       TestStandD.RefreshMappingInfo()
             
       var project_file = TestStandD.FindChild(Array("WndCaption"),Array("Open Project File"),100)
       project_file.OpenFile(path+ DDT.CurrentDriver.Value(0))
       //Delay(1000)
       Log.Picture(Sys.Desktop, "Tested application is being closed...!!!")
       var picture = ImageRepository.SetVersion.Designer
       Log.Picture(Sys.Desktop, "Tested application is being closed...!!!")
       if(picture.Exists())
       { 
          picture.Click()
          Log.Picture(Sys.Desktop)
          Sys.Keys("[Enter]")

          var pckverpanel = TestStandDCtrl.FindChild(Array("ClrClassName","WinFormsControlName"),Array("UpdateOrSetVersionDialog","UpdateOrSetVersionDialog"),100)
          pckverpanel.Activate()
          pckverpanel.SetFocus()
          pckverpanel.Click()
          var SetVersionBtn = pckverpanel.FindChild(Array("ClrClassName","WinFormsControlName"),Array("Button","setVersionButton"),100)
          SetVersionBtn.Click()
          var SetVersionForm = TestStandDCtrl.FindChild(Array("ClrClassName","WinFormsControlName"),Array("SetVersionForm","SetVersionForm"),100)
          var newver = SetVersionForm.FindChild(Array("ClrFullClassName","WinFormsControlName"),Array("System.Windows.Forms.ComboBox","newVersionComboBox"),100)
          newver.Click()
          newver.Keys("[Down]")
          var SetVerB = TestStandDCtrl.FindChild(Array("ClrFullClassName","WinFormsControlName"),Array("System.Windows.Forms.Button","setVersionButton"),100)
          SetVerB.Click()
          var Openfile = TestStandDCtrl.FindChild(Array("ClrFullClassName","WinFormsControlName"),Array("System.Windows.Forms.Button","openFileButton"),100)
          Openfile.Click()
          Log.Message("Version set process completed")

          
        }    
        else
        {
          Log.Message("No Change in Version number / Cannot find the message box") 
        }
        var GeneralDataAdapter = Aliases.TestStandDesigner.HwndSource_TaskPluginWrapperView
        var update = GeneralDataAdapter.FindChild(Array("ClrFullClassName","WPFControlName"), Array("System.Windows.Controls.TextBlock","Step"),500)
        val = update.Text.OleValue
        var str = "TSD updated\r\n[Ready]"
        while(val.Exists=true )
        {       
          val = update.Text.OleValue
          if(val==str)
          break
        }

        var closeBtn = GeneralDataAdapter.FindChild(Array("ClrClassName","WPFControlText"),Array("Button","Close"),100)
        closeBtn.Click()
        Delay(500)
        
        driveraddteststand.Next()
        
    }
        DDT.CloseDriver(driveraddteststand.Name)
        var ExitApp = menupanel.WPFMenu.Click("Project|Exit")
        TestedApps.TerminateAll()          
        TestedApps.Clear();
}

 

ChandanD_0-1601304333514.png

 

6 REPLIES 6
Highlighted
Community Manager

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Thank you for posting your question!

 

Is anybody working with Jenkins has any suggestions about this one? Your help will is appreciated!

@tristaanogre @Reshail @anupamchampati 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Leader

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Sorry I have not worked on Jenkins yet so cannot help.

Highlighted
Contributor

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Hi @chand,

When you say its not getting recognized on Jenkins you mean to say its running on a different environment? If it is running on a different environment you might want to try capturing the images again specifically for that environment. Keep in mind that image recognition requires each pixel to match if the resolution is not the same it wont work. 

Highlighted
Contributor

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Both the system are Windows 10, Test Complete,Test Execute version are same. Application is also same.

Only I can see is screen resolution is different in development environment and Jenkins environment. 

Ideally if I use image recognization then both are same. 

Highlighted
Contributor

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

I have found a workaround solution. If anyone is interested to know let me know

Highlighted
Community Manager

Re: Image is getting recongnised on my machine but it is not getting recognised on Jenkins.

Hi @ChandanD ! I am glad to hear you found a workaround!

 

It would be highly appreciated if you could share it in this thread!


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors