RRT Posted April 27, 2018 Share Posted April 27, 2018 Hi, I find it very difficult to implement an appropriate script to go through the domain selection field (one of three options) and switch to the user name and password fields. This is the WEB identification screen for the HP OneView system - appends the relevant HTML section: (I would like to chose the "ccc.il" option) <div class="hp-form-content"> <label for="hp-authn-provider-select" data-localize="core.login.directory">Directory</label> <div class="hp-select-form"><div class="hp-select" tabindex="0"><label style=""></label><div class="hp-value" data-id="1" style="">ccc.il</div><ol class="hp-options" style="padding-top: 0px;"><li data-id="0" class=""><span class="hp-name">Local</span></li><li data-id="2" class=""><span class="hp-name">carlsberg.il</span></li><li data-id="1" class="hp-selected"><span class="hp-name">ccc.il</span></li></ol></div><select id="hp-authn-provider-select" class="hp-select hp-select-select" style="display: none;"> <option value="0">Local</option><option value="2">car.il</option><option value="1">ccc.il</option></select></div> </div> Link to comment Share on other sites More sharing options...
jdelaney Posted April 27, 2018 Share Posted April 27, 2018 (edited) _IETagNameGetCollection _IEFormElementOptionSelect Edited April 27, 2018 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
RRT Posted April 27, 2018 Author Share Posted April 27, 2018 Yeh i already try that but im getting wrong syntax message, I guess I'm wrong in script syntax :-) Link to comment Share on other sites More sharing options...
Danp2 Posted April 27, 2018 Share Posted April 27, 2018 Post your code. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
RRT Posted April 27, 2018 Author Share Posted April 27, 2018 #include <IE.au3> $site = "https://hp-oneview" $oIE = _IECreate($site) $ohp-select = _IEGetObjById($oIE, "hp-value") $ohp-Select = _IETagNameGetCollection($ohpselect, "ccc.il", 0) $ohp-select.focus _IEFormElementOptionSelect($ohp-Select, "ccc.il", 1, "byText") Yeh i already try that but im getting wrong syntax message, I guess I'm wrong in script syntax :-) Link to comment Share on other sites More sharing options...
Danp2 Posted April 27, 2018 Share Posted April 27, 2018 I can see two obvious errors in the _IETagNameGetCollection line -- Missing hypen in the variable name The 2nd parameter should be a tag name, ie: div, input, span, etc Also, your _IEGetObjById will fail because there isn't any element with the id "hp-value". This appears to be a element's class. There are plenty of examples on the forum of retrieving an element by it's class, so I would suggest that you dig a little deeper for a solution. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Subz Posted April 27, 2018 Share Posted April 27, 2018 You can't have hyphens in a variable name, otherwise you're going to get syntax errors, so change $ohp-select to $ohpselect Also the select option is actually hidden (id = "hp-authn-provider-select") and so you would need to test a, whether you can change the selection and if it has any effect on the "divs" above which are what you actually see on the page. Hope that makes sense. Danp2 1 Link to comment Share on other sites More sharing options...
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