Podcast
Questions and Answers
Which method is more preferred for accessing image links in Selenium Webdriver?
Which method is more preferred for accessing image links in Selenium Webdriver?
- By.cssSelector (correct)
- By.linkText()
- By.xpath
- By.partialLinkText()
What attribute of an element can be used to access an image link in Selenium Webdriver?
What attribute of an element can be used to access an image link in Selenium Webdriver?
- id
- title (correct)
- class
- name
What is the purpose of the following line of code: 'driver.findElement(By.cssSelector("a[title="Go to Facebook home"]")).click();'
What is the purpose of the following line of code: 'driver.findElement(By.cssSelector("a[title="Go to Facebook home"]")).click();'
- To access the 'Facebook' logo on the upper left portion
- To close the WebDriver
- To verify if we are taken to Facebook's homepage
- To click on the 'Facebook' logo on the upper left portion (correct)
What is the purpose of the following line of code: 'if (driver.getTitle().equals("Facebook - log in or sign up"))'
What is the purpose of the following line of code: 'if (driver.getTitle().equals("Facebook - log in or sign up"))'
What is the expected title of Facebook's homepage in the example provided?
What is the expected title of Facebook's homepage in the example provided?
What is the purpose of the following line of code: 'driver.close();'
What is the purpose of the following line of code: 'driver.close();'
What is the value of 'baseUrl' in the example provided?
What is the value of 'baseUrl' in the example provided?
What is the purpose of the following line of code: 'System.setProperty("webdriver.chrome.driver","G:\chromedriver.exe");'
What is the purpose of the following line of code: 'System.setProperty("webdriver.chrome.driver","G:\chromedriver.exe");'
What is the purpose of the following line of code: 'WebDriver driver = new ChromeDriver();'
What is the purpose of the following line of code: 'WebDriver driver = new ChromeDriver();'
What is the purpose of the following line of code: 'driver.get(baseUrl);'
What is the purpose of the following line of code: 'driver.get(baseUrl);'