Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

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

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

Read text in TXT and store in Variable 111

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:

Read text in TXT and store in Variable 210

Thanks!
avatar
sunny mehndiratta
Regular Participant
Regular Participant
Posts : 25
Join date : 2013-03-22

Read text in TXT and store in Variable Empty 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
rohit13
rohit13
Master
Master
Posts : 180
Join date : 2012-03-29
Age : 38
Location : INDIA
http://radical-qa.blogspot.in/

Read text in TXT and store in Variable Empty 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
avatar
guicps89
Posts : 5
Join date : 2013-03-14

Read text in TXT and store in Variable Empty 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! Very Happy
Sponsored content

Read text in TXT and store in Variable Empty Re: Read text in TXT and store in Variable

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