Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression on opening and using a PDF file
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
How can I change my script using RegEx to ignore these _1, _2 … etc and [1], [2]…etc?

Please see my attachment for a visual example.

The "ALL IMAGED CLIENT DOCUMENTS" is in my OR. But now my web page shows ALL IMAGED CLIENT DOCUMENTS[1].zip and the pdf file show ALL IMAGED CLIENT DOCUMENTS_1.pdf. If I continue, both will jump to [2] and _2 respectfully.

I am not sure if I add

Code:
Window("ALL IMAGED CLIENT DOCUMENTS/_[0-9]").Activate
and
Window("ALL IMAGED CLIENT DOCUMENTS").WinListView("SysListView32").Select "ALL IMAGED CLIENT DOCUMENTS/_[0-9]/.pdf"


current code:
Code:
Window("ALL IMAGED CLIENT DOCUMENTS").Activate
Window("ALL IMAGED CLIENT DOCUMENTS").WinListView("SysListView32").Select "ALL IMAGED CLIENT DOCUMENTS_1.pdf"
Window("ALL IMAGED CLIENT DOCUMENTS").WinToolbar("ToolbarWindow32_3").Press "&File"
Window("ALL IMAGED CLIENT DOCUMENTS").WinMenu("ContextMenu").Select "Open"
Window("ALL IMAGED CLIENT DOCUMENTS").Activate
Window("ALL IMAGED CLIENT DOCUMENTS").HighLight(0)

I have been reading up on RegEx (https://www.learnqtp.com/regular-express...gularized/) but I have found myself even more confused. lol


Attached Files
.doc   Regular Expression on opening and using a PDF file.doc (Size: 104 KB / Downloads: 97)
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
ALL IMAGED CLIENT DOCUMENTS((\[[0-9]+\])|(_[0-9]+)).(pdf|zip)

Change the OR windows text to use this Expression. Hopefully that will solve your issue or at least lead you in the right direction.
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Thank you so much. I will try this asap. Presently, I am using Window("regexpwndtitle:=ALL IMAGED CLIENT DOCUMENTS.*") but your code will help in another situation.

wonderfull
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,496 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,831 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,579 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,123 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 2 Guest(s)