Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use same script for multiple URLs
#21
PLEASE SEE ATTACHMENT. I THINK THAT'S THE PROBLEM. PLEASE CONFIRM ONCE PROBLEM SOLVED SO THERE USER CAN USER CAN UNDERSTAND EASILY.

Code:
DataTable.Import("C:\nis.xls") For i =1 to DataTable.GetSheetCount DataTable.SetCurrentRow i Print DataTable("Username",dtGlobalSheet) Print DataTable("password",dtGlobalSheet) Print"id"& DataTable.Value("Username") Print DataTable.Value("password") Next


Above code is working and tested. please see


Attached Files Image(s)
   
Reply
#22
Hi,

Thanks a lot.. Now the described error is removed.. it was because of while pasting code, it copies wrong ", which is now corrected.

Now new error occurs which is attached.... Please help me with it..


Attached Files Image(s)
   
Reply
#23
Before loop try to get the number of rows and assign that to some variable like "rowcount=DataTable.RowCount"
msgbox rowcount

For i=rowcount
xxxx
yyyy
Next
Reply
#24
Hi,

Tried as per your suggestion.. but same error occurs.. pls review attached screen shot..

Thanks,
Mansi.


Attached Files Image(s)
   
Reply
#25
Try with the below one


Code:
sVal=Datatable.GetRowCount For i = sVal
Reply
#26
Hey,, now its fully working, without error Smile

Thank you so much..

But still I have one issue.. Please review below code and attached snap shot of datasheet.. According to me, on running this script, it should first login into first URL and then next one and after that it should be stopped.. But with below code, it first login into with first URL, then next one and "AGAIN login with first URL and second one" which is wrong.. Can you please corrrect me what is wrong in below code??

--------------
Code:
DataTable.Import("D:\Book1.xls") For i=1 to Datatable.GetRowCount DataTable.SetCurrentRow i SystemUtil.Run DataTable("URL",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtUsername").Set DataTable("Username",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtPassword").Set DataTable("Password",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebButton("Login").Click 'Select facility' 'Browser("InSync :: Login").Page("InSync :: Login_2").WebList("ddlFacility").Select ("Local Facility") Browser("InSync :: Login").Page("InSync :: Login_2").WebButton("Ok").Click Browser("InSync :: Login").Close Next

------------


Attached Files Image(s)
   
Reply
#27
Hi,

Can anyone please help me urgently....

When I run below script, it performs goes into infinite loop.. Consider that in datasheet I have 5 rows in my data sheet, it executing scripting multiple times, though all 5 URL are once opened and described operations are mentioned. It should open each 5 URL one time instead of multiple time.. Please let me know where I am wrong in below script?

---------------

Code:
DataTable.Import("D:\Book1.xls") For i=1 to Datatable.GetRowCount DataTable.SetCurrentRow i SystemUtil.Run DataTable("URL",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtUsername").Set DataTable("Username",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebEdit("txtPassword").Set DataTable("Password",dtGlobalSheet) Browser("InSync :: Login").Page("InSync :: Login").WebButton("Login").Click Browser("InSync :: Login").Page("InSync :: Login_2").WebList("ddlUsers").Select DataTable("User",dtGlobalSheet) 'Select facility' Browser("InSync :: Login").Page("InSync :: Login_2").WebButton("Ok").Click Wait (1) 'Access Scheduler Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image2").Click Wait (1) 'Access Patient Search Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image3").Click Browser("InSync :: Login").Page("InSync :: Patient Search").Image("Edit Patient").Click Wait (1) 'Access Facesheet Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image4").Click Wait (1) 'Access New Charge 'Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$Image5").Click 'Wait (1) 'Access Document Manager Browser("InSync :: Login").Page("InSync :: Dash Board").Image("ctl00$Header1$ibtndocumnetmgr").Click Wait (1) Browser("InSync :: Login").Close Next

-----------

Thanks,
Mansi.
Reply
#28
Help me pleaseeeeeeeeeeee...
Reply
#29
Is the test settings for datatable run on all rows?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#30
Hi Basanth,

Yes Test setting for datatable run on all rows, which was wrong.. Due to which loop enters in infinite... Now it is working fine for me..

Thanks a lot to all of you for your precious help. Smile .. With all of your help, I was able to prepare a complete script for my project..Thanks again..
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to run same script for different URLs when loading time is different mansis 5 5,933 09-21-2012, 12:42 PM
Last Post: mansis
  Multiple users executing QTP script using Excel Input vinodindia 0 3,487 07-05-2012, 11:41 PM
Last Post: vinodindia
  Switching between URLs sqadri 1 3,139 02-01-2012, 07:36 AM
Last Post: rajpes
  Multiple input values from a reusable action call from main script knightofdawn 0 3,724 08-30-2010, 01:23 PM
Last Post: knightofdawn
Exclamation How to access multiple SAP sessions by script? Osprey 1 8,397 06-24-2010, 04:11 PM
Last Post: Osprey

Forum Jump:


Users browsing this thread: 1 Guest(s)