Contributions
Re: How to get substring from a text
nmrao I expect to do assertion. def feature = context.expand( '${Check Feature_JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row/NAME[text()="UVA "]//following-sibling::ENABLED}' ) assert feature == true But I don't expect the tailing space after keyword 'UVA'. Because the tailing space might disappear every once. I wonder if we could use the similar statement? Otherwise, I have to break my script into several lines.3 years agoPlace ReadyAPI QuestionsReadyAPI Questions1KViews0likes0CommentsRe: How to get substring from a text
nmraothank you. But do you have any other ideas? Example XML result: <Results> <ResultSet fetchSize="128"> <Row rowNumber="1"> <NAME>UVA </NAME> <SUBSCRIPTIONKEY>1858219</SUBSCRIPTIONKEY> <ACCOUNTKEY>101</ACCOUNTKEY> <ENABLED>true</ENABLED> <STARTDATE>2020-06-29 20:38:00.0</STARTDATE> <ENDDATE>2022-12-31 00:00:00.0</ENDDATE> </Row> <Row rowNumber="2"> <NAME>UV </NAME> <SUBSCRIPTIONKEY>1858220</SUBSCRIPTIONKEY> <SUBSCRIPTIONKEY>103</SUBSCRIPTIONKEY> <ENABLED>false</ENABLED> <STARTDATE>2019-06-29 20:38:00.0</STARTDATE> <ENDDATE>2022-12-31 00:00:00.0</ENDDATE> </Row> </ResultSet> </Results> I expect to assert something like context.expand( '${Check Feature_JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row/NAME[text().trim()="UVA"]//following-sibling::ENABLED}'== true3 years agoPlace ReadyAPI QuestionsReadyAPI Questions1.1KViews0likes0CommentsHow to get substring from a text
//get feature def feature = context.expand( '${Check Feature_JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row/NAME[text()="UVA "]//following-sibling::ENABLED}' ) The space after keyword 'UVA' might disappear sometimes.How could I update the script to avoid the space? Thanks. Something like: context.expand( '${Check Feature_JDBC#ResponseAsXml#//Results[1]/ResultSet[1]/Row/NAME[text().trim()="UVA"]//following-sibling::ENABLED}' )1.1KViews0likes6Comments