C# help needed

Status
Not open for further replies.

JamieJayden

Regular Member
Joined
Apr 17, 2018
Messages
205
Reaction score
85
Hi guys,
im trying to program a simple bot as im still learning C# .
Now I am stuck at something, see code below:
.Document.GetElementById("firstname").SetAttribute("Jamie");
could anyone tell me what I should write before the dot?
ps: im not using windows forms so i cannot use webBrowser 1 :p
any help would be much appreciated!
 
Please be more specific. Are you using Selenium? At first glance it looks like you need to use the instance of your web driver.

On my phone so bare with me.

Chromedriver driver = new Chromedriver();

driver.Document.GetElementByID("firstname").SetAttribute("Jamie");
 
Please be more specific. Are you using Selenium? At first glance it looks like you need to use the instance of your web driver.

On my phone so bare with me.

Chromedriver driver = new Chromedriver();

driver.Document.GetElementByID("firstname").SetAttribute("Jamie");
thanks for your reply, i tried your code but it says that the type could not be found.
 
I believe you need to specify the attribute you're trying to set.
 
Code:
Chromedriver driver = new Chromedriver();

driver.document.getElementByID("firstname").setAttribute("attributename", "attributevalue");
 
still says type chromedriver could not be found
 
Please post your website and tell me which attribute you want to fill and I will post you the code.
i know the id's of my attributes already , that not the problem bro
 
Hey buddy, it seems like you are lacking basic knowledge about how dependencies works.
You have to install the selenium WebDriver extension on visual studio, this will install the necessary DLLs

I can't post URLs but if you google for "Set Up Selenium WebDriver with Visual Studio in C#" you will find a good tutorial
 
Status
Not open for further replies.
Back
Top