0

XML DSL

 <citrus-ftp:client id="ftpClient"
      host="${var1}"
      port="${var2}"
      username="${var3}"
      password="${var4}"
      timeout="10000"/>

Steps.XML

<spring:beans xmlns="http://www.citrusframework.org/schema/cucumber/testcase"

    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    
    xmlns:spring="http://www.springframework.org/schema/beans"
    
    xmlns:citrus="http://www.citrusframework.org/schema/testcase"
    
    xmlns:citrus-ftp="http://www.citrusframework.org/schema/ftp/config"
    
   
    xmlns:citrus-http="http://www.citrusframework.org/schema/http/config" 
    
    xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    
    http://www.springframework.org/schema/beans/spring-beans.xsd
    
     http://www.citrusframework.org/schema/cucumber/testcase 
     
     http://www.citrusframework.org/schema/cucumber/testcase/citrus-cucumber-testcase.xsd 
    
    http://www.citrusframework.org/schema/http/config
    
    http://www.citrusframework.org/schema/http/config/citrus-http-config.xsd
    
   
    http://www.citrusframework.org/schema/ftp/config
   
  
    http://www.citrusframework.org/schema/ftp/config/citrus-ftp-config.xsd">

 <citrus-ftp:client id="ftpClient"
      host="${var1}"
      port="${var2}"
      username="${var3}"
      password="${var4}"
      timeout="10000"/>
 
    
      
<spring:import resource="FTP_Template.xml" />
<step given="^Test FTP connection">
<citrus:call-template name="MyFTP">
</citrus:call-template>
</step>
</spring:beans>

Cucumber Feature File

Scenario: Test FTP
        Given FTP Host:"localhost"
        Given FTP Port:"21"
        Given FTP Username:"ravi"
        Given FTP Password:"admin"
        Given Test FTP connection

I have a cucumber feature file. In the file, I am declared the variables FTP host port username password. I need to make the feature file variables as an input to <citrus-ftp: client> to make dynamic configuration through feature files. Could anyone please help me with this

  • Could you please help me with this. @Christoph Deppisch – Ravi Kishore Mar 30 '21 at 18:24
  • Hi Ravi, We need more info to be able to help you. You say you're using Cucumber, but what programming language? Ruby? Java? JavaScript? Something else? What form do you want the XML to end up in? Do you just need it as a string in memory, or a file on disk? What have you tried so far? – Matt Wynne Mar 30 '21 at 18:40
  • I developed the cucumber feature as above. I am declaring the step definitions in the file. Steps.xml . These all are running in Java Spring Boot environment. where I am stuck is need to pass feature file variable to the citrus FTP client as above. – Ravi Kishore Mar 31 '21 at 09:32
  • I'm afraid I can't help. I have neveer seen this use of XML like this for defining cucumber steps. – Matt Wynne Mar 31 '21 at 16:52
  • Maybe you could try asking in the #help-cucumber-jvm Slack channel: https://cucumberbdd.slack.com/archives/C5YHPPJMP – Matt Wynne Mar 31 '21 at 16:53
  • I am able to get the cucumber feature file variable data to step files like as parnameter names But I need to input this variable values to citrus ftp client as above. I think I need to get help from the citrus side like how to pass dynamic variables to FTP. Thanks – Ravi Kishore Apr 01 '21 at 17:11

0 Answers0