1

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>
    <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.

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Right now I can't access to the Selenium Reference provided in your answer (the server doesn't responds), but that solution doesn't work for me because the browser opens the URL with "${YourVariableName}" instead of the variable name. I'm wondering if this Issue is still pending: github.com/SeleniumHQ/selenium-ide/issues/226

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.