Search
 
 

Display results as :
 


Rechercher Advanced Search

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Read text in TXT and store in Variable

View previous topic View next topic Go down

Read text in TXT and store in Variable

Post by guicps89 on Wed Apr 10, 2013 3:33 am

Hi there,

I have a script here that everytime before I run it, I have to manually type a purchase ID to store in a variable and click on Play to run the script. The problem is that there are days, that I have more than 100 Ids to type there and run, and it's a little tiring sometimes. Here's the script that I use:



My question is: is there a way to write all the code Ids I need in a TXT file, one per line, and execute a command that: reads the line, store the text in this variable, execute all the rest, and then on the next iteration, it reads the second line to get the new code, store it again on the variable and execute the script again? I would put it in a WHILE loop to execute this scripts as many times as it should.

The TXT file would look like this:



Thanks!

guicps89

Posts : 5
Join date : 2013-03-14

Back to top Go down

Re: Read text in TXT and store in Variable

Post by sunny mehndiratta on Wed Apr 10, 2013 11:35 am

hello, i have not tried parameterization in selenium ide thatswhy i m not sure about ide, but it is possible in selenium rc... In that we can make a excel file and we are not bothered to use while command we just have to give the purchase id it ll automatically take the purchase id again.....if u need help about rc then i can try to help u out in this scenario

sunny mehndiratta
Regular Participant
Regular Participant

Posts : 25
Join date : 2013-03-22

Back to top Go down

Re: Read text in TXT and store in Variable

Post by rohit13 on Wed Apr 10, 2013 12:14 pm

It is possible in IDE.

You need to use parametrization.

You can refer
http://radical-qa.blogspot.in/2012/02/selenium-ide-parametrization.html

_________________
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: Read text in TXT and store in Variable

Post by guicps89 on Wed Apr 10, 2013 7:12 pm

Hi, thanks for the suggestions, it worked like a charm! Very Happy

guicps89

Posts : 5
Join date : 2013-03-14

Back to top Go down

Re: Read text in TXT and store in Variable

Post by Sponsored content Today at 3:24 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