Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

js substr in IDE

View previous topic View next topic Go down

js substr in IDE

Post by dainova 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

dainova
Active particpant
Active particpant

Posts : 19
Join date : 2012-02-23

Back to top Go down

Re: js substr in IDE

Post by sharath 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

sharath
Regular Participant
Regular Participant

Posts : 29
Join date : 2012-08-04

Back to top Go down

Re: js substr in IDE

Post by dainova on Tue Sep 11, 2012 11:19 pm

Tx, I thought taht "$14.34" is the string already, will try.

dainova
Active particpant
Active particpant

Posts : 19
Join date : 2012-02-23

Back to top Go down

Re: js substr in IDE

Post by rosco on Thu Sep 13, 2012 8:14 pm

it seems weird to use storetext with javascript.

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: js substr in IDE

Post by rohit13 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/

rohit13
Master
Master

Posts : 180
Join date : 2012-03-29
Age : 30
Location : INDIA

http://radical-qa.blogspot.in/

Back to top Go down

Re: js substr in IDE

Post by Sponsored content Today at 10:41 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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