Can someone tell me does this code work on his/her computer? It’s written in CSharp Selenium.

using NUnit.Framework; using OpenQA.Selenium; using OpenQA.Selenium.Firefox; using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ToolsQA { class automation {[Test] public void Test() { IWebDriver driver = new FirefoxDriver(); driver.Url = “http://www.toolsqa.wpengine.com/automation-practice-form/”; IList<IWebElement> oRadioBtn = driver.FindElements(By.Name(“sex”)); bool SEX = oRadioBtn.ElementAt(0).Selected; if (SEX == true) { oRadioBtn.ElementAt(1).Click(); } else { oRadioBtn.ElementAt(0).Click(); } } IWebElement radioBtn_Exp = driver.FindElement(By.Id(“exp-2”)); radioBtn_Exp.Click(); IWebElement oCheckBox = driver.FindElement(By.CssSelector(“input[value=’Selenium IDE’]”)); oCheckBox.Click(); } } }

Default Asked on December 21, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.