Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression Syntax
#21
I am confused now.. are you trying to have a regular expression in OR for page identification or you are trying to navigate to page 2

Reply
#22
Hi Saket,

Below is the link for which i want to use regex in OR.
And regex used in OR is mentioned below:
http.*://210.212.12.163/.*/.*/.*.php?.*


Attached Files Image(s)
   
Reply
#23
so this should work properly to identify page 2 as well. isn't it working? what the error says?

Reply
#24
Now when i run the script, it goes to the next web page and the links on the page gets changed shown below:
On coming to that web page shown below, it click on [First Page]or [Prev] instead of Link 3.
This the reason why i want to remove the page=1 so that it works properly.

Hope this explains my problem.

Regards,
Anu


Attached Files Image(s)
   
Reply
#25
so the issue is for clicking the page links, this is not becuase you have done the regular expression for page url. however it will help to identify the page correctly after each click.

to click on the different page links, see if below code helps you
Code:
'Put your statement for the initial steps '... 'get the number of links Set oLinks = Description.Create oLinks("micclass").Value = "Link" oLinks("html tag").Value = "A" Set AllLinks = Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search").ChildObjects(oLinks) nLinks =AllLinks.count For i = 1 to nLinks oLinks("text").Value = i 'Put your statements to test the Page here '... '... Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search").Link(oLinks).Click Next 'Leave the OR as it is you have done till now
let me know if I am still not getting your issue properly Smile

Reply
#26
Hi Saket,

The code is bit confusing.One reason is that i do not know Descriptive programming and in this code may be you have used that.

Could you please tell me where to add this code. The code which i am using is mentioned below:

Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable Const ForAppending = 8 const TristateTrue=-1 file_location = "C:\Test.xlsx" '----------'For Wirting in Excel Sheet' Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.WorkBooks.Open("C:\Test.xlsx") Set xlSheet = xlBook.WorkSheets("Sheet1") CountOfRows=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").RowCount nRow = xlSheet.UsedRange.Rows.Count For i = 1 To CountOfRows-1 '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 xlApp.DisplayAlerts = False xlBook.Save 'xlBook.Close xlApp.Quit Set xlApp = Nothing Set xlBook = Nothing Set xlSheet = Nothing Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("LinkTable").Link("2").Click

Waiting for your response.

Regards,
Anu
Reply
#27
here is the simplified code
Code:
Dim xlSheet,xlBook, xlApp,a,CustomerName,Address,datatable Const ForAppending = 8 const TristateTrue=-1 file_location = "C:\Test.xlsx" '----------'For Wirting in Excel Sheet' Set xlApp = CreateObject("Excel.Application") Set xlBook = xlApp.WorkBooks.Open("C:\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").ChildObjects(oLinks) nLinks =AllLinks.count For i = 1 to nLinks'* CountOfRows=Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("DataTable").WebTable("Table").RowCount nRow = xlSheet.UsedRange.Rows.Count For i = 1 To CountOfRows-1 '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").Link(oLinks).Click Next '* xlApp.DisplayAlerts = False xlBook.Save 'xlBook.Close xlApp.Quit Set xlApp = Nothing Set xlBook = Nothing Set xlSheet = Nothing 'Browser("Meghalaya Directory Search").Page("Meghalaya Directory Search_3").WebTable("LinkTable").Link("2").Click

Reply
#28
Hi Saket,

I have done the modification as per your previous post. But on running the script following error comes shown below:


Attached Files Image(s)
   
Reply
#29
OK, I have used the same variable 'i' which you have already used, Please change it to some other variable and proceed

Reply
#30
Hi Saket,

Thnks for the support Smile

Could you please tell me why u have used in the code below:
Code:
Set oLinks = Description.Create oLinks("micclass").Value = "Link" oLinks("html tag").Value = "A"

Regards,
Anu
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 4,073 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,816 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 4,401 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 17,103 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,465 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)