There is a site with this structure:
the NAMEN field that appears on the button is the default name chosen in the options.
Explaining better: A button appears with a default name (NAMEN). When clicking on this button it shows me more names that when chosen will rename the original button and execute the necessary routine.
I can get the name in the options but I can't select it for the original button.
I can access the original button with:
And I can go to the new name line with:
(on of 17 is the relative position in the list of names)
text1 has the desired new name to replace NAMEN
How can click in the chosen name to execute routine?
Any idea?
Thanks
The site is fot currency conversion: Banco Central do Brasil
HTML:
<button _ngcontent-hpq-c150="" dropdowntoggle="" id="button-convert" type="button" aria-label="resul1" class="form-control dropdown-toggle" aria-haspopup="true" aria-expanded="false"> NAMEN <span _ngcontent-hpq-c150="" class="caret"></span></button>
<ul _ngcontent-hpq-c150="" id="resul1" role="menu" aria-labelledby="button3" class="dropdown-menu scrollable-menu" style="left: 0px; right: auto; display: none;">
<li _ngcontent-hpq-c150="" role="menuitem"><a _ngcontent-hpq-c150="" class="dropdown-item"> NAME1 </a></li>
<li _ngcontent-hpq-c150="" role="menuitem"><a _ngcontent-hpq-c150="" class="dropdown-item"> NAME2 </a></li>
"
"
<li _ngcontent-hpq-c150="" role="menuitem"><a _ngcontent-hpq-c150="" class="dropdown-item"> name179 </a></li>
the NAMEN field that appears on the button is the default name chosen in the options.
Explaining better: A button appears with a default name (NAMEN). When clicking on this button it shows me more names that when chosen will rename the original button and execute the necessary routine.
I can get the name in the options but I can't select it for the original button.
I can access the original button with:
HTML:
driver.FindElementByXPath("//button[@id='button-convert']").Click
And I can go to the new name line with:
Code:
text1=driver.FindElementByXPath("//ul[@id='resul1']/li[17]/a").Text
text1 has the desired new name to replace NAMEN
How can click in the chosen name to execute routine?
Any idea?
Thanks
The site is fot currency conversion: Banco Central do Brasil
Last edited by a moderator: