'How can I click a Dropdown menu option in a webpage using VB.NET and Selenium
I am trying to click on Supplier. I've added a screen shot of the source code. In this code sample I have successfully logged into the site, but the next step is to click on that dropdown to get to the next screen. I have hard coded the link and then used GET to call open the URL string. However, it's my understanding that I should be able to do this without hard coding the URL for Supplier. I should be able to pull it with a single line of code versus trying to figure out how to loop through somehow to get to the "Supplier" selection. I am trying to account for the scenario if this link changes so I want my code to pull it directly from the source vs hard coding. I've uploaded a screen shot of the source code. How can I click on supplier? 
Dim ch As New Selenium.ChromeDriver
Dim FindBy As New Selenium.By
ch.Get("URL", raise:=False)
ch.SwitchToFrame("MainFrame")
ch.FindElementById("ctl04_txtUsername").SendKeys(Form1.TxtBId.Text)
ch.FindElementById("ctl04_txtPassword").SendKeys(Form1.TxtBPass.Text)
ch.FindElementById("ctl04_btnLogin").ClickDouble
str = "https://am.adech.net/csge/portals/postmodern/desktpdefault.aspx?tabindex=1&tabid=211&sTarget=S"
ch.Get str, Raise:=False
Solution 1:[1]
The answer to my question is:
First find the element by ID, find that elements anchor by tag, next getattribute by "href" and then navigate to that anchors "href" link.
Solution 2:[2]
This is not the good practice, you can do the following
"gallery": [
{
"id": 1,
"image": require(`../assets/data/item/dog1.jpg`) // this way
},
....
]
const Thumbnail = (props) => {
.....
<Image source={image} style={styles.image} />
....
}
You can find details Here
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Block Block |
| Solution 2 | Nooruddin Lakhani |
