| || |
How to check the checkbox and write in edit box
I am using the API tester to push in the xml's to see for the order creation in an e-commenrce platform.
I have writtien the code to get the url of the API tester from the data sheet-->invoke the IE and then navigate to this API tester (thru the fetched URL).
Now in this page i need to check a checkbox and write the service name to be used in one of the edit box available. My script hangs in the line where i say for the checkbox to set to 'On'.
When i use the spy and check for the IE (which is opened thru the script) i see no properties (like WebCheckBox,WebEdit...etc)listed at all and for everything the spy says as WinObject. But if i open teh API tester separetely (after stopping the script) and do a spy, i see all of the objects recognised correctly like for checkbox it says WebCheckBox and so on. Hence i am not able to script the part where i have to actually check the edit box and write the service name in the edit box.Can you please describe me why is this and the possible scripting solution for this?
My script as below,
Dim EditToSearch, ValueToSet, NumberOfEdits
'This is the value of the 'name' property for the WebEdit object we want to find.
EditToSearch = "ServiceName"
ValueToSet = Trim (SheetName.cells(row,5).value) 'the service name is picked up from external excel
'Create a description object to help retrieve all WebEdit objects in a specific page.
Set oDesc = Description.Create()
oDesc("micclass").Value = "WebEdit"
oDesc("name").Value = "ServiceName"
'Retrieve all WebEdit objects in this page
Set EditCollection = Browser("micClass:=Browser").Page("micClass:=Page" ).ChildObjects(oDesc)
NumberOfEdits = EditCollection.Count
'Search for a specific WebEdit object and set its value
For i = 0 To NumberOfEdits - 1
If EditCollection(i).GetROProperty("name") = EditToSearch Then
Also note that for the browser i am using the generic way of 'micClass'.I do not want to ahrd code the browser name, so it should run on the only opened API tester browser.
Re: How to check the checkbox and write in edit box
do record and play .. if it works .. if yes .. then you can get the exact object properties for the check box.