11-19-2010, 03:31 PM
Hi everybody,
I encountered a problem while trying to write a qtp script for a webtool. After searching for solutions the last couple of days I really can't imagine how to fix this.
Ok, so the situation is this, I have a webpage that generates a dynamic table. Every row of that table corresponds with a specific demand and starts with 3 buttons (one to view the details of the demand, one to accept the demand and one to cancel the demand) followed be fields with extra info (for example the name of the employee who made the demand). The goal of my script is to accept all the demands of a given employee. I wrote following script:
Now, I added the okButton.Highlight into the script to check if I really selected the correct button, which was the case. However, I get no reaction at all from "okButton.Click" (it seems the button isn't clicked).
I also tried by replacing "okButton.Click" by "buttonArray(indexArray).Click", however I got the same result.
Does anybody knows what I did wrong and how to solve this?
I encountered a problem while trying to write a qtp script for a webtool. After searching for solutions the last couple of days I really can't imagine how to fix this.
Ok, so the situation is this, I have a webpage that generates a dynamic table. Every row of that table corresponds with a specific demand and starts with 3 buttons (one to view the details of the demand, one to accept the demand and one to cancel the demand) followed be fields with extra info (for example the name of the employee who made the demand). The goal of my script is to accept all the demands of a given employee. I wrote following script:
Code:
max=Browser("My website").Page("My website").WebTable("Demands_Holiday").RowCount
teller=1
Set document=Browser("My website").Object.Document
Set buttonArray=document.getElementsByTagName("INPUT")
buttonAmount=buttonArray.length
msgbox(buttonAmount)
n=0
Do while teller<max
indexAccept=((teller-1)*3)+1
indexArray=(((teller-1)*3)+1)+17
teller=teller+1
veld=Browser("My website").Page("My website").WebTable("Demands_Holiday").GetCellData(teller,7)
If veld="Bauer Jack" Then
Set okButton=Browser("My website").Page("My website").WebButton("type:=button","index:=" & indexAccept)
okButton.Highlight
Browser("My website").Page("My website").Syn
okButton.Click
End If
Loop
Now, I added the okButton.Highlight into the script to check if I really selected the correct button, which was the case. However, I get no reaction at all from "okButton.Click" (it seems the button isn't clicked).
I also tried by replacing "okButton.Click" by "buttonArray(indexArray).Click", however I got the same result.
Does anybody knows what I did wrong and how to solve this?