Please ensure to include your code between [code][/code] tags while asking or replying to questions.

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Dynamic link and Regular expression

12-27-2010, 06:50 PM
Post: #1
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago Dynamic link and Regular expression

Hi All,

In recent Interview I have asked one Question on how to click a link.
The scenario is as below.

On the First page, we have text box.
We have to enter the required text in the Text box, click on Submit button.
On Next page dynamic link generated based on entered text in previous page.

For example

If we enter Shashi Kiran, the link displayed on the next page is
UFC 125:Shashi Kiran's video Interview.

If we enter only Kaitrina,the link name displaced is
UFC 125:Katrina Kai's video Interview.

Here 'UFC 125:' and 'video Interview' remain's constant.

Also the displayed link position on the next page is not constant.It displayed alphabetaly in desc order.

How we handle this situation ?
Find all posts by this user
Quote this message in a reply
12-28-2010, 09:20 AM
Post: #2
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago RE: Dynamic link and Regular expression
it's not required that you should use regualar expression.
you can use descriptive programming for this by forming the links innertext/innerhtml with the input text you entered in the last page.

Find all posts by this user
Quote this message in a reply
12-28-2010, 11:30 AM
Post: #3
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago RE: Dynamic link and Regular expression
Hi Saket,
thnks for your valuable reply.
I am not able to validate below script, as it is generic and not related to any particular application.
But still want to conform if below script/approach is correct or wrong.

To enter value in text box

Code:
Browser("name:=orkut - login").Page("name:=orkut - login").WebEdit("text:=Video to search").Set "Kaitrina Kaif"

To get entred text in a variable.

Code:
a= Browser("name:=orkut - login").Page("name:=orkut - login").WebEdit("text:=Video to search").Getroproperty("text")
To click on Submit button

Code:
Browser("name:=orkut - login").Page("name:=orkut - login").Webbutton("value:=Submit")
To click the rquired link.

Quote:
Code:
Browser("name:=orkut - login").Page("name:=orkut - login").Weblink("html tag:=A","inner html:=UFC 125:Katrina Kai's video Interview").click

Please let me know, if i am correct up to this.
Now the problem here is, I want to make above script run for any Text entered in first page.

In the innerhtml Instead of 'Katrina Kai's', I want to pass the variable value I captured during runtime in

Code:
a= Browser("name:=orkut - login").Page("name:=orkut - login").WebEdit("text:=Video to search").Getroproperty("text")

Please correct me if my approach is correct.
Find all posts by this user
Quote this message in a reply
12-28-2010, 11:37 AM
Post: #4
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago RE: Dynamic link and Regular expression
Yes, you in right direction
take a variable and store your input string into it, and use it for the link

e.g
Code:
strInput = "Kaitrina Kaif"
Browser("name:=orkut - login").Page("name:=orkut - login").WebEdit("text:=Video to search").Set strInput
'... rest of the statements to submit
Browser("name:=orkut - login").Page("name:=orkut - login").Weblink("html tag:=A","inner html:=UFC 125:" & strInput & "'s video Interview").click

Find all posts by this user
Quote this message in a reply
12-28-2010, 11:51 AM
Post: #5
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago RE: Dynamic link and Regular expression
Thank you very much Saket Smile
Find all posts by this user
Quote this message in a reply
03-03-2011, 02:16 PM
Post: #6
Solved: 1 Year, 2 Weeks, 6 Days, 20 Hours, 26 Minutes, 42 Seconds ago RE: Dynamic link and Regular expression
Its very useful. Thank you....but my application Silverlight 4.0. can u give dynamic link validation for supporting silverlight 4.0 application
Find all posts by this user
Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Regular expression in descriptive programming testernc 0 503 01-30-2014 02:06 AM
Last Post: testernc
Rolleyes Help Required : In Understanding the regular expression arescool 0 585 08-15-2013 08:59 AM
Last Post: arescool
  Need help with regular expression Please Assist RA185112 5 1,311 02-15-2013 01:56 PM
Last Post: selvam
  LInk reg expression QAVA 3 1,073 02-14-2013 11:06 AM
Last Post: Ankesh
  Very interesting issue with regular expression Please Help Me :) dzordz 3 1,736 02-01-2013 01:35 PM
Last Post: RA185112



User(s) browsing this thread: 1 Guest(s)