- guicps89
- Posts : 5
Join date : 2013-03-14
Read text in TXT and store in Variable
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!
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 mehndirattaRegular Participant
- Posts : 25
Join date : 2013-03-22
Re: Read text in TXT and store in Variable
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
Re: Read text in TXT and store in Variable
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
You need to use parametrization.
You can refer
http://radical-qa.blogspot.in/2012/02/selenium-ide-parametrization.html
- guicps89
- Posts : 5
Join date : 2013-03-14
Re: Read text in TXT and store in Variable
Wed Apr 10, 2013 7:12 pm
Hi, thanks for the suggestions, it worked like a charm!
- How to store user input in variable using selenium RC
- how to store csscount/xpath count in a variable and increment it?
- how to verify the condition using verifytext and store the value in to variable either true or false.
- Write the variable into a text file.
- Need Resolution "How to store the particular text in a page and use it other field"
Permissions in this forum:
You cannot reply to topics in this forum