Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regular expression
#11
Thanks a lot for your time. still having problem. pls see attached if that helps you why i am getting the error.


Attached Files
.doc   forum.doc (Size: 80.5 KB / Downloads: 256)
Reply
#12
Looks to me like this is getting too complicated. When you were doing the inline descriptive programming, you were not closing the strings and passing each property as a parameter:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Frame("micclass:=Frame").Link("micclass:=Link,html tag:=a,text:=(Junk)$|Junk[\d\)\(]+").Click

Should be like this:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Frame("micclass:=Frame").Link("micclass:=Link", "html tag:=a", "text:=(Junk)$|Junk[\d\)\(]+").Click

That being said, I think that the expression is not taking in to account what appears to be a space between the "Junk" and the number. I think the expression can be greatly simplified as well:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Link("html tag:=A", "text:=Junk( \(\d+\))?").Click

This expression says "click the link that has the text 'Junk' that may or may not be followed by the expression ' \(\d+\)' which says the text '<one space><one left parenthesis><one or more digits><one right parenthesis>'" Hope this helps!
Reply
#13
When using multiple descriptors, try the following:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Frame("micclass:=Frame").Link("micclass:=Link","html tag:=a","text:=(Junk)$|Junk[\d\)\(]+").Click

Note, the quotes are given between each attribute.

Also, in object identification, add other properties name, innertext, outertext, visible as well. Delete the object inbox() added in object repository, and again add it to OR with these properties.

Make sure you check 'regular expression' checkbox in the properties of the object in OR.
Try with the value Inbox ([0-9].*) in Value configuration options of the property in OR, and do not set '\' backslash. Set Regular expression checkbox.
With all this set, try with
Code:
Browser("micclass:=Browser").Page("micclass:=Page").Frame("micclass:=Frame").Link("innertext:=Inbox ([0-9].*)").Click
Reply
#14
Thanks .

I am still having same problem. Pls see attached.

I had:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Frame("micclass:=Frame").Link("micclass:=Link","html tag:=a","text:=(Junk)$|Junk[\d\)\(]+").Click


One thing I noticed that Inbox/Junk both has a html tag = A.

I am doing it in hotmail as i said. If you can do the same in hotmail, i dont know why i cant do it.

Thanks.



one improvement. i added one more property.

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Link("micclass:=Link","html tag:=A","abs_y:=267", "text:=Junk( \(\d+\))?").Click

this code works, if Junk folder has any number(ex: Junk(1), Junk(2)), it clicks. But if Junk folder has no number, no parenthesis, then it gives me error. ex: Junk

Pls help. thx.


Attached Files
.doc   forum1.doc (Size: 135 KB / Downloads: 120)
Reply
#15
When Junk folder was empty, using object spy, i found Junk text value was : Junk ()

When Junk folder had one email, using object spy, i found Junk text value was : Junk (1)

Just letting you know.

Thanks.
Reply
#16
Ah ha! That's the trick then! I thought that when there was nothing in the folder, the parenthesis and digits would both be gone. try:

Code:
Browser("micclass:=Browser").Page("micclass:=Page").Link("html tag:=A", "text:=Junk \(\d*\)").Click

This says: click the link that has the text "Junk (" that may have zero to many digits followed by the text ")". Also, when doing inline descriptive programming, you do not have to call out the micclass property since it is implied by the fact that you are calling the Link() function. We only use it for Browser and Page as dummy properties so that we get back the only Browser with any Page on it (i.e no identification properties).
Reply
#17
You are awesome. Now it works. Many thanks.
When you have a chance, can you explain me the following expressions?
"text:=(Junk)$|Junk[\d\)\(]+") //what the dollar and plus sign for?

"text:=Junk( \(\d+\))?") //here what is the question mark meaning?

Also, do you have any messenger/email so i can ask you more questions?Smile
Reply
#18
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)