Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
oalejo2000phpbb
Posts : 1
Join date : 2010-08-25

Javascript and parsing a string Empty Javascript and parsing a string

Wed Aug 25, 2010 12:21 am
Hello all, I have recently started using selenium and I have been trying to automating it using a little javascript.
The issue that I am having is trying to pass variable from Selenium to Javascript, but I have been unable to do it. I keep getting a variable not defined javascript error. I was wondering if someone can point me on the right path.

basically my script is like this:

Get a value from a table:
command: storeTable
Target: //td[2]/table.3.9
Value: SMSTemplate

Plug part of value from above table into a field in my html page:
Command: type
Target: phoneNumber
Value: javascript{var temp = new String(); temp =SMSTemplate.substring(3,7);}

I get the following error in the second command:
[error] Unexpected Exception: message -> SMSTemplate is not defined, fileName ->
chrome://selenium-ide/content/selenium/scripts/selenium-api.js, lineNumber ->
2482, stack -> ("javascript{var temp = new String(); temp
=SMSTemplate.substring(3,4);}")@chrome://selenium-ide/content/selenium/scripts/selenium-api.js:2482
("javascript{var temp = new String(); temp
=SMSTemplate.substring(3,4);}")@chrome://selenium-ide/content/selenium/scripts/selenium-api.js:2482
()@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:110
()@chrome://selenium-ide/content/selenium/scripts/selenium-executionloop.js:78
continueCurrentTest()@chrome://selenium-ide/content/selenium-runner.js:335
()@chrome://selenium-ide/content/debugger.js:166
("cmd_selenium_pause")@chrome://selenium-ide/content/editor.js:235
doCommand("cmd_selenium_pause")@:0
goDoCommand("cmd_selenium_pause")@chrome://global/content/globalOverlay.js:96
oncommand([object
XULCommandEvent])@chrome://selenium-ide/content/selenium-ide.xul:1 , name ->
ReferenceError
Back to top
Permissions in this forum:
You cannot reply to topics in this forum