Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WEBEDITS Help ASAP!
#1
Solved: 11 Years, 3 Months, 3 Weeks ago Question 
Greetings,

I have to create a QTP script that will populate the following webedits:
Email Address
Re-enter Email Address
Member Name
Choose Password
Re-enter Password

then click submit button.

Here is the tricky part. The script must loop and the text for the Email Address, Re-enter Email Address, and Member Name must be different in every single iteration.

Any ideas?

Thanks!
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
If it is loop condition obviously u need to pass data using datatable to application

Suggestions:
1.Before sending the values to application first delete the duplicate data in datatable itself
2.Then pass the data which is without duplicates to the application


Here for second step u might not be having any issue directly u can pass the data to the application

For the first step i am giving u some advisable scenario's

Deleting a duplicate rows from excel sheet
_______________________________________________
Code:
set aa=Createobject("Excel.Application")
set b=aa.Workbooks.open("D:\batchu.xls")
set c=aa.worksheets("sheet1")
c.Cells.Sort c.Range("A1"),1,,,,,,2,1,False,,,1
m=datatable.getrowcount
m=50  'number of rows avaialable in excel sheet
for j=1 to 10 step 1 'just to find the number of duplicates even if it is more than 2 duplicates in this case i considered up to 10 duplicate records
for i=1 to m step 1
d=c.cells(i,1).value
if c.cells(i,1).value=c.cells(i+1,1).value then
'msgbox m
'msgbox c.cells(i+1,1).value
c.Rows(i+1).delete
b.save
m=m-1
'msgbox m
end if
if i=m then
'msgbox i
'msgbox m
Exit for
end if
Next
Next
'msgbox d
b.close

Please let me know if u need any informatiuon aprt from this.

Thanks,
Venkat.Batchu
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
first, please refrain yourself from using the words like ASAP. This will do nothing but annoy forum members with no end.

for your query, you will need to parameterize this using datatable, create a column for each fields.
enter values of each column in the rows for number of iteration you need to test.
Now loop throgh each row and set the values in fields.

Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Thank you Venkat.

The WebEdits does not accept data(email address, member id) of an already registered member, so I need to develop a script to store or output the data from the first run into an excel. I will use this data to validate that the webedits doesn't accept this data and gives appropriate errors. Do you know how to do this?


Code:
'Enter Email Address
Browser().Page(").WebEdit("Email Address").Set DataTable("Email_Address", dtLocalSheet)

'Enter Member Name
Browser().Page().WebEdit("MemberName").Set DataTable("Member_Name", dtLocalSheet)

Best Regards,

Raphael
Greetings Saket,


I parameterize using the data table with 50 rows but the script reads the first row only and ends. How can I loop through all 50 rows for number of iterations I need to test. I enter the values of each column in the rows directly in into the Action table. Is there a run time setting i need to modify or maybe I created the data table incorrectly. Please let me know.

Thanks & Best Regards,

Raphael
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
You can loop through all the rows using a for loop
e.g
Code:
For i = 1 to 50
    Datatable.Getsheet(dtLocalsheet).SetCurrentRow(i)
    'Your Statements...
Next

Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi,
As u were saying that
The WebEdits does not accept data(email address, member id) of an already registered member,

then first supress the duplicate data in excel sheet itself (i.e which u r going to pass the data to the application) so finally this sheet without duplicates after doing some script changes. Then finally pass this data to the application then your problem will solve.

Thanks,
Venkat.Batchu
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)