Selenium IDE: Pass a variable to open URL
The below is my Selenium IDE generated XML file.
<?xml version="1.0" encoding="UTF-8"?>
<TestCase seleniumIDEVersion="1.0.10" baseURL="http://test.com/">
<selenese>
<command>open</command>
<target><![CDATA[/test/contract/?testId=743474]]></target>
<value><![CDATA[]]></value>
</selenese>
<selenese>
开发者_JS百科 <command>clickAndWait</command>
<target><![CDATA[link=View All Test menus]]></target>
<value><![CDATA[]]></value>
</selenese>
</TestCase>
I want to pass a variable here /test/contract/?testId={variable here}
instead of the number.
Is it possible, please help me.
Just code /test/contract/?testId=${YourVariableName}
and Selenium will substitute it in. Obviously you'll need to set the variable first, from whatever source you get it from. The Selenium reference has some examples.
精彩评论