Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Geting issues in identifying the elsements in webdriver
Fri Feb 17, 2017 4:41 pm by janbaskt

» WebDriver - why not to use a singlton for it?
Fri Feb 17, 2017 4:40 pm by janbaskt

» WebDriver session when using testng annotation to invoke driver instance
Fri Feb 17, 2017 4:39 pm by janbaskt

» Selenium fails to launch Chrome
Fri Feb 17, 2017 4:39 pm by janbaskt

» why do i get this error
Fri Feb 17, 2017 4:38 pm by janbaskt

» Selenium Tutorial
Thu Feb 16, 2017 5:21 pm by Rahul

» When to use Selenium IDE, RC and WebDriver
Mon Feb 13, 2017 2:35 pm by azharuddin

» How to integrate selenium with ZAPI-Zephyr
Sat Feb 11, 2017 2:25 am by gseera002c

» Selenium Webdriver
Sat Feb 04, 2017 6:47 pm by soumyamishrav@gmail.com

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


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