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
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

Creating the account (URL) globally and using that variable where ever it needed Empty Creating the account (URL) globally and using that variable where ever it needed

Wed Dec 08, 2010 7:03 pm
Creating the account (URL) globally and using that variable where ever it needed.


public string acct = String.Format("selenium{0}", System.DateTime.Now.ToString().Replace("/","").Replace(" ","").Replace(":","").ToString());

In the last line of the script we will get the complete URL.
selenium.Open("http://marketing.staging.XXX.com/PM-FreeTrial.aspx");
selenium.Type("SignUp1_txtWebAddress", acct);
selenium.Type("SignUp1_txtCompanyName", acct);
//submit
selenium.Click("//a[@id='SignUp1_btnAdd']/span");

After submitting we get other link like this
selenium.Open(String.Format("http://{0}.staging.XXX.com/manager", acct ));


In the script ( "acct" is the global variable and we are prefixing with the word 'selenium' and the getting the systemdatetime and calling that variable)

The problem is : I need to use that account (URL) in the another script. to open that created account.
Can anyone please help with this.


selenium.testing07
selenium.testing07
Regular Participant
Regular Participant
Posts : 26
Join date : 2010-11-20

Creating the account (URL) globally and using that variable where ever it needed Empty Re: Creating the account (URL) globally and using that variable where ever it needed

Wed Dec 08, 2010 7:55 pm
Well,
To open this created account you need call this class or script in another class script.
Something like, you have to define multiple class.
Implement the same and let me know, if any issue?


Thanks,
Smile
yoursjcp
yoursjcp
Active particpant
Active particpant
Posts : 10
Join date : 2010-07-22

Creating the account (URL) globally and using that variable where ever it needed Empty Re: Creating the account (URL) globally and using that variable where ever it needed

Thu Dec 09, 2010 2:42 pm
Hi
Thanks for the reply..

How to call one class or script into another script..
we cant define multiple class in a script.

Mainly we need the solution is to get the URL in to the another script and need to open that URL in another script.
We created that URL globally and calling that variable in the class and getting the final URL. I need to call this final URL in the another script.

Thanks


Sponsored content

Creating the account (URL) globally and using that variable where ever it needed Empty Re: Creating the account (URL) globally and using that variable where ever it needed

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