Share
Go down
dainova
Active particpant
Active particpant
Posts : 19
Join date : 2012-02-23

js substr in IDE

on Tue Sep 11, 2012 1:11 am
Hi, can anybody help how to do right syntax for subscript method inside IDE, no matter what I tried it failes for now:

Code:

| StoreText | //*[@id="M_MainContent_Amount"]  | amt1
| echo    | ${amt1| |                  //** $14.34

Now I need to cut of that dollar sign $ to get  just <14.34>???
| StoreText | javascript{$amt1.substr(1)  | amt1a    //-- ERROR

Thanks all
Dai
sharath
Regular Participant
Regular Participant
Posts : 29
Join date : 2012-08-04

Re: js substr in IDE

on Tue Sep 11, 2012 11:36 am
Hi Dai,

First you have to convert the integer to string value.Then only it is possible to substring.

Hope this helps,
Sharath
dainova
Active particpant
Active particpant
Posts : 19
Join date : 2012-02-23

Re: js substr in IDE

on Tue Sep 11, 2012 11:19 pm
Tx, I thought taht "$14.34" is the string already, will try.
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

Re: js substr in IDE

on Thu Sep 13, 2012 8:14 pm
it seems weird to use storetext with javascript.
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: js substr in IDE

on Fri Sep 14, 2012 8:31 pm
Code:
store | $14.34 | string
store | 1 | delimiter
store | javascript{storedVars['string'].split('$')[storedVars['delimiter']]} | amt
echo  |  ${amt}


This is solution for your problem

_________________
Radical QA
http://radical-qa.blogspot.in/
Sponsored content

Re: js substr in IDE

Back to top
Permissions in this forum:
You cannot reply to topics in this forum