Forum Discussion

SriniG's avatar
SriniG
Contributor
11 years ago
Solved

How to enable buttons when it was disabled on execution of vbscript using DOM modal

Hi,



While running Vbscript on IE browser, buttons are disabled and unable to click on buttons but when i'm checking manually able to click on buttons.



Please let me know how to overcome this issue using DOM?



Note: its working fine when we use Descriptive programing.



Browser used: IE11

Modal used : DOM 

Script : VBscript.



Thankyou,

Srini.
  • Hi Srini,

     


    The getElementById method returns an HTML element from the page. I would suggest that you use TestComplete's methods to get an object and perform a click on it. For example, you can use the FindChild method.


     

4 Replies

  • Hi Srini,

     


    The getElementById method returns an HTML element from the page. I would suggest that you use TestComplete's methods to get an object and perform a click on it. For example, you can use the FindChild method.


     

  • Hi Srini,

     


    I don't quite understand your task. Could you please post some screenshots with the description of what you want to do?


     

  • Hi Tanya,



    I'm working on a Web application. One page is having Radio buttons and Buttons.



    After selecting the 'Radio button' from the page then "Next Room" button will enable otherwise it will be in disable mode.



    See the attached screenshot .



    Now problem is, While running the script  "Next Room" button is in disable mode eventhough "Radio button" was selected.



    Script used:-



    Function getWidget(strTagName,strType,strProperty) 

    set page = sys.Browser("iexplore").Page("*").contentDocument 

    select case split(strProperty,":=")(0)

     case "id"

      set wgt = page.getElementById(split(strProperty,":=")(1))

    end select

     set getwidget = wgt

    End Function




    Function Clickbutton1(strTagName,strType,strProperty,strValue)  


      set wgt = getWidget(strTagName,strType,strProperty)


      if not wgt is nothing then


       wgt.click


       strFlag = True


      else


        strFlag = False


      end if


      set wgt = nothing


      Clickbutton1= strFlag


    End Function

     

    Note:- "Next Room" button will enable if we click  'Radio button" manually.



    Could you please let me know the solution for the above case.



    Thank you,

    Srini.