Share
Go down
guicps89
Posts : 5
Join date : 2013-03-14

Read text in TXT and store in Variable

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!
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Re: Read text in TXT and store in Variable

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
avatar
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 31
Location : INDIA
http://radical-qa.blogspot.in/

Re: Read text in TXT and store in Variable

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/
guicps89
Posts : 5
Join date : 2013-03-14

Re: Read text in TXT and store in Variable

on Wed Apr 10, 2013 7:12 pm
Hi, thanks for the suggestions, it worked like a charm! Very Happy
Sponsored content

Re: Read text in TXT and store in Variable

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