Wertz Posted November 29, 2018 Posted November 29, 2018 Hi, I'm new with autoit. I'm trying to execute a snippet of a javascript code to insert a select tag with an option. I'm creating a macro to automate data input iteration on a webpage, but at some point, I need to select a dropdownlist that after the onChange event, enable a new dropdown with one option only, and also make two fields stay hidden. Could you help me?
faustf Posted November 29, 2018 Posted November 29, 2018 yea we can help you but you must send a code and webpage ... we wait
Wertz Posted November 29, 2018 Author Posted November 29, 2018 Local $oCombo1 = _IEGetObjById($oIEB, "EstruturaComercial_CodSegmento") _IEFormElementOptionSelect($oCombo1, "1", 1) Sleep(1000) Local $oCombo2 = _IEGetObjById($oIEB, "EstruturaComercial_CodCanalVenda") _IEFormElementOptionSelect($oCombo2, "3", 1) Local $oTextA = _IEGetObjById($oIEB, "EstruturaComercial_CodConcessionario") _IEFormElementSetValue($oTextA, "9035334") Local $oTextC = _IEGetObjById($oIEB, "EstruturaComercial_NomeConcessionario_Ex") _IEFormElementSetValue($oTextC, "CONSIGA SEG CORR DE SEGS LTDA") Local $oCombo3 = _IEGetObjById($oIEB, "EstruturaComercial_CodBsCorretor") _IEFormElementOptionSelect($oCombo3, "446819", 1) Local $oTextB = _IEGetObjById($oIEB, "EstruturaComercial_CodAngariador") _IEFormElementSetValue($oTextB, "9035334") Local $oTextD = _IEGetObjById($oIEB, "EstruturaComercial_NomeAngariador_Ex") _IEFormElementSetValue($oTextD, "CONSIGA SEG CORR DE SEGS LTDA") Local $oCombo3 = _IEGetObjById($oIEB, "EstruturaComercial_CodBsAngariador") _IEFormElementSetValue($oCombo3, "448546") Local $oTextE = _IEGetObjById($oIEB, "EstruturaComercial_CD_GERENTE_PRODUTO") _IEFormElementSetValue($oTextE, "9806") Local $oSubmit = _IEGetObjById($oIEB, "BTN_EstruturaComercial_Avancar") _IEAction($oSubmit, "click") The web page that I'm trying to automate, depends on login and password, because it is a bank ... follow a print so you understand better. Thank you
Wertz Posted November 29, 2018 Author Posted November 29, 2018 I have the js file that contains the function I need to use. What happens is that when I click on the first combo (id = CommercialStructureCodeSection), in the onChange event the select tag with the caption "Canal de venda(*)" is automatically populated with a default value.
Danp2 Posted November 29, 2018 Posted November 29, 2018 Have you tried using _IEFormElementOptionSelect to set the value of the CommercialStructureCodeSection combo? Latest Webdriver UDF Release Webdriver Wiki FAQs
Wertz Posted November 29, 2018 Author Posted November 29, 2018 Yes, but as there is an onChange event in the click on the first dropdown, it did not work ... This is being my difficulty ...
Danp2 Posted November 29, 2018 Posted November 29, 2018 The site uses jQuery, so you should be able to use the following to trigger the onChange event -- Latest Webdriver UDF Release Webdriver Wiki FAQs
Wertz Posted November 29, 2018 Author Posted November 29, 2018 Thank you, man! I'll test here and post it on the topic as soon as I can.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now