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
#2
Not Solved
I've got the same problem with you while doing exercise with yahoo mail and gmail.
For yahoo mail, I tried using "button.Submit" and it worked.
I did the same for gmail, but it didn't work this time, still can't find out the solution, I don't wanna click on position on screen, still trying to find another solution...
Reply
#3
Not Solved
Hi

Can you try once by changing the if statementas below
Instead of:
Code:
If veld="Bauer Jack" Then
write as:
Code:
If (StrComp(veld,"Bauer Jack")=0) Then
And Please let me know.
Reply
#4
Not Solved
Tried it, didn't change anything (which I expected, since I am able to go in the 'If' statement).
Reply
#5
Not Solved
HI hellspawn,

Could you attach your current requirement screenshots?
Reply
#6
Not Solved
What do you mean by requirement screenshots?
Reply
#7
Not Solved
Probably screenshot of your application.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how can i click a macro button in excel using vbscript arpan 1 3,757 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,466 08-25-2015, 07:37 PM
Last Post: kathirvelnagaraj
  Unable to click on the WebButton with specified Index srach84 2 4,298 03-31-2015, 04:36 AM
Last Post: srach84
  Unable to click on WebButton in WebTable srach84 1 3,106 02-09-2015, 09:07 PM
Last Post: arpan
  Unable to select Multiple OracleTextFields by Holding Ctrl Button Raghava M 0 1,867 07-04-2014, 01:40 PM
Last Post: Raghava M

Forum Jump:


Users browsing this thread: 1 Guest(s)