All Downloads are FREE. Search and download functionalities are using the official Maven repository.

t.jspringbot-xml.1.0.source-code.libdoc.intro Maven / Gradle / Ivy

There is a newer version: 1.9
Show newest version
JSpringBot XML Library for Robot Framework.

= Configuration =

Configure the following to use jspringbot-xml.

1. Add this artifact in maven dependency

|  
|    
|      org.jspringbot
|      jspringbot-xml
|    
|  

2. Import spring-xml in {{jspringbot-global.xml}}

| 

3. Add {{JSpringBotGlobal}} library in the in the test suite settings.

| *** Settings *** |
| Library | JSpringBotGlobal |


*Sample xmlString*
| 
| 
|    
|       Gambardella, Matthew
|       XML Developer's Guide
|       Computer
|       44.95
|       2000-10-01
|       An in-depth look at creating applications with XML.
|    
|    
|       Ralls, Kim
|       Midnight Rain
|       Fantasy
|       5.95
|       2000-12-16
|       A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.
|    
|    
|       Corets, Eva
|       Maeve Ascendant
|       Fantasy
|       5.95
|       2000-11-17
|       After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
|    
| 

*Create sample xmlString*
| `Start XML Node`    | catalog |
| `Start XML Node`    | book |
| `Add XML Attribute` | id | bk101 |
| `Start XML Node`    | author |
| `Set XML Text`      | Gambardella, Matthew |
| `End XML Node`      |
| `Start XML Node`    | title |
| `Set XML Text`      | XML Developer's Guide |
| `End XML Node`      |
| `Start XML Node`    | genre |
| `Set XML Text`      | Computer |
| `End XML Node`      |
| `Start XML Node`    | price |
| `Set XML Text`      | 44.95 |
| `End XML Node`      |
| `Start XML Node`    | publish_date |
| `Set XML Text`      | 2000-10-01 |
| `End XML Node`      |
| `Start XML Node`    | description |
| `Set XML Text`      | An in-depth look at creating applications with XML. |
| `End XML Node`      |
| `End XML Node`      |
| `Start XML Node`    | book |
| `Add XML Attribute` | id | bk102 |
| `Start XML Node`    | author |
| `Set XML Text`      | Ralls, Kim |
| `End XML Node`      |
| `Start XML Node`    | title |
| `Set XML Text`      | Midnight Rain |
| `End XML Node`      |
| `Start XML Node`    | genre |
| `Set XML Text`      | Fantasy |
| `End XML Node`      |
| `Start XML Node`    | price |
| `Set XML Text`      | 5.95 |
| `End XML Node`      |
| `Start XML Node`    | publish_date |
| `Set XML Text`      | 2000-12-16 |
| `End XML Node`      |
| `Start XML Node`    | description |
| `Set XML Text`      | A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world. |
| `End XML Node`      |
| `End XML Node`      |
| `End XML Node`      |
| ${bookCatalog}=     | `Create XML String` |
| `Should Be Equal As Strings` | Gambardella, MatthewXML Developer's GuideComputer44.952000-10-01An in-depth look at creating applications with XML.Ralls, KimMidnight RainFantasy5.952000-12-16A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world. | ${bookCatalog} |

*Sample XML Keyword Usage:*
| `Set XML String` |  |
| ${author}= | `Get XML XPath Elements` | //catalog/book[1]/author |
| ${first_book}= | `Get XML XPath Element` | //catalog/book  |
| ${third_book}= | `Get XML XPath Element` | //catalog/book[3] |
| ${id}= | `Get XML Element Attribute` | ${first_book} | id |
| ${genre}= | `Get XML XPath Element Text Content` | ${first_book} | //book/genre |
| ${description}= | `Get XML XPath Single Text Content` | //catalog/book[1]/description |
| ${description_list}= | `Get XML XPath Text Contents` | //catalog/book/description |
| ${match_count}= | `Get XML Xpath Match Count` | //catalog/book/price[text()='5.95']/.. |
| `XML Element Attribute Should Be Equal` | ${third_book} | id | bk103 |
| `XML Xpath Should Match X Times` | //catalog/book/price[text()='5.95']/.. | 2 |
| `XML XPath Text Content Should Be Equal` | //catalog/book/author | Gambardella, Matthew |
| `XML XPath Text Content Should Be Equal` | //catalog/book[2]/author | Ralls, Kim |

=>
| ${author} =  Gambardella, Matthew
|
| ${first_book} = 
|   Gambardella, Matthew
|   XML Developer's Guide
|   Computer
|   44.95
|   2000-10-01
|   An in-depth look at creating applications with XML.
| 
|
| ${third_book} = 
|   Corets, Eva
|   Maeve Ascendant
|   Fantasy
|   5.95
|   2000-11-17
|   After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
| 
|
| ${id} = bk101
| ${genre} = Computer
| ${description} = After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
| ${description_list} = [An in-depth look at creating applications with XML., A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world., After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.]
| ${match_count}= 2

*Sample XML Function Usage:*
| `Set XML String` |  |
| `EL Add Variable` | firstBookId | $[xml:attr('//catalog/book[1]','id')] |
| `EL Add Variable` | book | $[xml:element('//catalog/book')] |
| `EL Add Variable` | books | $[xml:elements('//catalog/book')] |
| `EL Add Variable` | secondGenre | $[xml:text('//catalog/book[2]/genre')] |

=>
| $[firstBookId] = "bk101"
|
| $[book] = 
|   Gambardella, Matthew
|   XML Developer's Guide
|   Computer
|   44.95
|   2000-10-01
|   An in-depth look at creating applications with XML.
| 
|
| $[books] =
| Element [0]:
| Gambardella, Matthew
| ${books} =
| Element [0]:
| 
|   Gambardella, Matthew
|   XML Developer's Guide
|   Computer
|   44.95
|   2000-10-01
|   An in-depth look at creating applications with XML.
| 
| Element [1]:
| 
|   Ralls, Kim
|   Midnight Rain
|   Fantasy
|   5.95
|   2000-12-16
|   A former architect battles corporate zombies, an evil sorceress, and her own childhood to become queen of the world.
| 
| Element [2]:
| 
|   Corets, Eva
|   Maeve Ascendant
|   Fantasy
|   5.95
|   2000-11-17
|   After the collapse of a nanotechnology society in England, the young survivors lay the foundation for a new society.
| 
|
| $[secondGenre] = "Fantasy"




© 2015 - 2024 Weber Informatics LLC | Privacy Policy