Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to change script for checkbox from Dropdown list
#1
Solved: 11 Years, 3 Months ago
Hi,
I have a VB script for Dropdown list which select the values (yes or no) from the Data table. but the requirement changed the Dropdown list to Check box. for an example : yes I have to check , else uncheck.

I have attached my script for Dropdwon list. If anyone can help me how to change this script to check box for same scenario?
Code:
Set oWebList = Description.Create
oWebList ("name").value = "XYZ" & i
oWebList ("name").RegularExpression = false
oWebList ("html tag").value = "SELECT"
Disabled=Browser("Browser").Page("Drivers").WebList(oWebList).GetROProperty ("disabled")
If  Disabled = "0" Then
Browser("Browser").Page("Drivers").WebList(oWebList).Select Datatable.Value ("Order" & i, dtlocalSheet)      
End If

Scenario: every time I add new driver I will get this dropdown list for each drive, hence my script have a loop for adding each driver and selecting Dropdown list value for each driver.

I am using QTP 9.5
Reply
#2
Solved: 11 Years, 3 Months ago
Try implementing your logic around this

Code:
If Strcomp ("Yes",Datatable.Value ("Order" & i, dtlocalSheet),1) = 0   Then
        flag = "ON"
        Else
        flag = "OFF"
    End If

If Disabled = "0" Then
    Browser("..").Page("..").WebCheckBox("..").Set  flag
End If
Reply
#3
Solved: 11 Years, 3 Months ago
Thank You so much for help. It works fine.....
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with Select checkbox from data table value jayraocourts 0 1,225 11-01-2019, 10:25 PM
Last Post: jayraocourts
Sad How To Find Dropdown Object based on Values from the dropdown list mesg2anil 12 33,926 12-19-2017, 10:25 PM
Last Post: sandy2404
  how to select value from google search box dropdown +QTP prajyot 0 2,875 06-28-2017, 06:30 PM
Last Post: prajyot
  Compare second web list value according to the first web list value roselin6 1 2,812 10-07-2015, 09:14 PM
Last Post: supputuri
Sad Click checkbox using its label name. venkatesh9032 1 3,159 08-10-2015, 10:33 PM
Last Post: kotaramamohana

Forum Jump:


Users browsing this thread: 1 Guest(s)