Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple QTP Question?

Status
Not open for further replies.

rbvoorheis

Technical User
Dec 26, 2007
1
US
I'm sure this is very simple. I'm just relatively new to this and I've spent about 6 hours on it now. =o(

I'm trying to use a Select Case statement to access a WebElement which is a text question on a web page. Based on the content or name of this WebElement, I want to click a particular answer button.

Thanks in advance to anyone who can help me.

Here is the code...

InvokeApplication "C:\Program Files\Internet Explorer\IEXPLORE.EXE
'Click Start Button.
Browser("Wolters Kluwer Brain Game").Page("Wolters Kluwer Brain Game").WebButton("Start The Game").Click

'Answer Questions.
For Questions = 1 To 20

Select Case Browser("Wolters Kluwer Brain Game").Page("Wolters Kluwer Brain Game").WebElement???

Case "In which city is Wolters"
Browser("Wolters Kluwer Brain Game").Page("Wolters Kluwer Brain Game").WebButton("Conshohocken, Pennsylvania").Click

Case "NASS stands for…"
Browser("Wolters Kluwer Brain Game").Page("Wolters Kluwer Brain Game").WebButton("North American Shared").Click

Case Else
Print "No Answer"

End Select

Next
 
try WebElement.Text or WebElement.Value

Cheers,
Dave

"Yes, I'll stop finding bugs in the software - as soon as you stop writing bugs into the software." <-- Me

For all your testing needs: Forum1393
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top