Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression Syntax
#31
Solved: 11 Years, 4 Months ago
I have used this to create the generic Link object with the properties specified.
Once we create that we can search for all the object in the page.
look into QTP help for more details.

Reply
#32
Solved: 11 Years, 4 Months ago
Hi Saket,

Thnks for the information...............

Regards,
Anu
Reply
#33
Solved: 11 Years, 4 Months ago
Hi Saket,

The code is working properly that is navigation to other web pages is happening but writting the data to excel is not proper.
The screen shot of excel is attached where the data is fetched after running the script.

Waiting for reply Sad

Regards,
Anu


Attached Files Image(s)
   
Reply
#34
Solved: 11 Years, 4 Months ago
Paste your modified code here

Reply
#35
Solved: 11 Years, 4 Months ago
Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable
Const ForAppending = 8
const TristateTrue=-1
file_location = "F:\Test.xlsx"


'----------'For Wirting in  Excel Sheet'

Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.WorkBooks.Open("F:\Test.xlsx")
Set xlSheet = xlBook.WorkSheets("Sheet1")
Set oLinks = Description.Create
oLinks("micclass").Value = "Link"
oLinks("html tag").Value = "A"

Set AllLinks = Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").ChildObjects(oLinks)
nLinks =AllLinks.count
For i = 2 to nLinks
CountOfRows=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").RowCount

nRow = xlSheet.UsedRange.Rows.Count
For j = 1 To CountOfRows
'a=Browser("Untitled Page").Page("Untitled Page_3").WebTable("Data_Table").GetCellData(i,1)
CustomerName=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,3)
Address=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(i,4)
nRow = nRow + 1
xlSheet.Rows(nRow).Columns(1).Value =CustomerName
xlSheet.Rows(nRow).Columns(2).Value =Address
Next
oLinks("text").Value = i
Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("LinkTable").Link(oLinks).Click
Next
xlApp.DisplayAlerts = False
xlBook.Save
'xlBook.Close
xlApp.Quit
Set xlApp = Nothing
Set xlBook = Nothing
Set xlSheet = Nothing
Reply
#36
Solved: 11 Years, 4 Months ago
Hi Saket,

I have pasted the code........

Please assist me.
Thanks in advance............

Regards,
Anu
Reply
#37
Solved: 11 Years, 4 Months ago
you have changed the loop variable to 'j' for second For loop, but did not change it at other placed where you have used. all are still 'i'
changed the second loop as below -
Code:
For j = 1 To CountOfRows
'a=Browser("Untitled Page").Page("Untitled Page_3").WebTable("Data_Table").GetCellData(j,1)
CustomerName=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(j,3)
Address=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").GetCellData(j,4)
nRow = nRow + 1
xlSheet.Rows(nRow).Columns(1).Value =CustomerName
xlSheet.Rows(nRow).Columns(2).Value =Address
Next

put your codes using proper formatting tags to make it more readable

Reply
#38
Solved: 11 Years, 4 Months ago
Hi Saket,

Now it works properly.

Regards,
Anu
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,497 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,361 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,832 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,582 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,124 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 2 Guest(s)