Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to click on a button
#1
Not Solved Sad 
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:
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?
Reply


Messages In This Thread
Unable to click on a button - by hellspawn - 11-19-2010, 03:31 PM
RE: Unable to click on a button - by ngocvo3103 - 11-19-2010, 03:46 PM
RE: Unable to click on a button - by hellspawn - 11-19-2010, 04:47 PM
RE: Unable to click on a button - by hellspawn - 11-19-2010, 06:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how can i click a macro button in excel using vbscript arpan 1 3,741 10-03-2017, 06:27 AM
Last Post: supputuri
  Not able to click the save button in Save As window while downloading from SAP kathirvelnagaraj 0 2,458 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Unable to click on the WebButton with specified Index srach84 2 4,291 03-31-2015, 04:36 AM
Last Post: srach84
  Unable to click on WebButton in WebTable srach84 1 3,099 02-09-2015, 09:07 PM
Last Post: arpan
  Unable to select Multiple OracleTextFields by Holding Ctrl Button Raghava M 0 1,861 07-04-2014, 01:40 PM
Last Post: Raghava M

Forum Jump:


Users browsing this thread: 1 Guest(s)