Selenium Fitnesse Bridge:如何存储和回显变量?
我正在使用,以便在Fitnesse中为Selenium编写测试。它非常棒,因为它涵盖了硒的所有功能。然而,我遇到的问题是像在Selenium IDE中一样存储变量 | !- fixtures.SeleniumFixture -!| | setup | http://www.google.com/ | *chrome /usr/lib/firefox-3.0.5/firefox | | open | http://www.google.com/ | | | storeLocation | here | | | echo | ${here} | | | !- fixtures.SeleniumFixture-| |设置|http://www.google.com/ |*chrome/usr/lib/firefox-3.0.5/firefox| |开|http://www.google.com/ | | |店址|此处|| |回声${here}| 像这样简单的东西应该可以很好地工作,但是当我保存测试时,我得到了一个错误,未定义的变量 | storeLocation | here | | | echo | undefined variable: here | | !define variable {variable} | echo | ${variable} | | |店址|此处|| |echo |未定义变量:此处|| 这根本没有道理。在回显变量之前,我先定义变量。当我运行测试时,我得到: | storeLocation | here | | | echo | undefined variable: here | undefined variable: here | |店址|此处|| |echo |未定义变量:此处|未定义变量:此处|Selenium Fitnesse Bridge:如何存储和回显变量?,selenium,fixtures,fitnesse,selenium-fitnesse-bridge,Selenium,Fixtures,Fitnesse,Selenium Fitnesse Bridge,我正在使用,以便在Fitnesse中为Selenium编写测试。它非常棒,因为它涵盖了硒的所有功能。然而,我遇到的问题是像在Selenium IDE中一样存储变量 | !- fixtures.SeleniumFixture -!| | setup | http://www.google.com/ | *chrome /usr/lib/firefox-3.0.5/firefox | | open | http://www.google.com/ | | | storeLocation | her
作者也在做同样的事情。为什么这对我不起作用?问题是Fitnesse越来越困惑了。它认为您没有定义变量 | storeLocation | here | | | echo | undefined variable: here | | !define variable {variable} | echo | ${variable} | | !定义变量{variable} |echo |${variable}|| 避免Fitnesse混淆的方法是用!-!来避开变量名 | storeLocation | here | | | echo | ${!-here-!} | | |店址|此处|| |回声${!-这里-!}| 现在,这将响应所需的响应 | !- fixtures.SeleniumFixture -!| | setup | http://www.google.com/ | *chrome /usr/lib/firefox-3.0.5/firefox | | open | http://www.google.com/ | | | storeLocation | here | | | echo | ${here} | http://www.google.com | | !- fixtures.SeleniumFixture-| |设置|http://www.google.com/ |*chrome/usr/lib/firefox-3.0.5/firefox| |开|http://www.google.com/ | | |店址|此处||
|回声${here}http://www.google.com | 问题是Fitnesse越来越困惑了。它认为您没有定义变量 | storeLocation | here | | | echo | undefined variable: here | | !define variable {variable} | echo | ${variable} | | !定义变量{variable} |echo |${variable}|| 避免Fitnesse混淆的方法是用!-!来避开变量名 | storeLocation | here | | | echo | ${!-here-!} | | |店址|此处|| |回声${!-这里-!}| 现在,这将响应所需的响应 | !- fixtures.SeleniumFixture -!| | setup | http://www.google.com/ | *chrome /usr/lib/firefox-3.0.5/firefox | | open | http://www.google.com/ | | | storeLocation | here | | | echo | ${here} | http://www.google.com | | !- fixtures.SeleniumFixture-| |设置|http://www.google.com/ |*chrome/usr/lib/firefox-3.0.5/firefox| |开|http://www.google.com/ | | |店址|此处|| |回声${here}http://www.google.com |