Skip to content

Commit

Permalink
add xml example
Browse files Browse the repository at this point in the history
  • Loading branch information
manykarim authored Sep 19, 2023
1 parent 158bacf commit c0fec6b
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions code-examples/xml/xml.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
*** Settings ***
Library XML
*** Test Cases ***
Check Request
${root} Parse Xml source=${CURDIR}/sample_request.xml
Element Text Should Be source=${root} xpath=.//intA expected=5
${text} Get Element Text source=${root} xpath=.//intA
Should Be Equal As Numbers ${text} 5
Modify intA Element in Request
${root} Parse Xml source=${CURDIR}/sample_request.xml
# What is the keyword to modify the text in an element?
Add an intC Element to Request
${root} Parse Xml source=${CURDIR}/sample_request.xml
Add Element source=${root} xpath=.//Multiply element=<intB>5</intB>
Save Xml ${root} path=updated_sample.xml
Remove an Element from Request
${root} Parse Xml source=${CURDIR}/sample_request.xml
# What is the keyword to remove an element?

0 comments on commit c0fec6b

Please sign in to comment.