Selenium for Beginners – Test your Love for Selenium! Welcome to your Selenium for Beginners Quiz! 1. My Friend John explained to me all about the getText action... I'm trying to remember what it returns... Probably a boolean value: True/false Oh, it returns the page's text Hmm... It returns nothing! Wait, I know! It returns the element's text It actually returns the value true in case the element exists and also returns the element's text 2. My manager threw this on my table and wanted me to reach the text ATID College. I know I have a few options for that so I will mark it ATID College By xpath By id By cssSelector By name By tagName By className 3. While browsing the Internet how to bake an apple pie, I stubmled upon this code. I might as well try to figure it out... driver.get("http://google.com"); driver.navigate().to("http://facebook.com"); The code will navigate only to Google's site The code will navigate only to Facebook's site The code will navigate to Google's site first, and then go to Facebook's site The code will navigate to Google's site and then will throw an exception that it does not know the function navigate 4. I'm in the mood for My Header, so I'll have to work my magic and extract it from the following command, by: <h1 id="header">My Header driver.findElement(By.id("header")).getText(); driver.findElement(By.name("My Header")).getText(); driver.findElement(By.id("h1")).getText(); driver.findElement(By.id("header=My Header")).getText(); 5. Before I open a silly bug for Mark, I'll want to go to the new tab of his new feature. so I better use the navigate.to command switch.to command move.to command start.new command 6. I want to execute the following command but I'm scared! Help me understand what it does: System.out.println(driver.getTitle()); Easy - You will get an exception that it does not know such a command Even easier - The site address will be printed to the console Haha... The code cannot be compiled getTitle will be printed to the console The page title will be printed to the console 7. Wow, I learned xpath! Now I'm trying to figure out if the following expression is legal: //*[id='user']/span Obviously YES Obviously NO Obviously it depends on the version 8. Oh no, our developer Alex just added in my page a few elements with id=test... I wonder what will the following command return? driver.findElement(By.id("test")); All of the elements The first element found in the page The last element found in the page A random element that will be found in the page 9. Cookies? The ones you eat with milk? Can Selenium even handle Cookies? Look for the definition of Cookies in Google, and in the meantime - You should know that YES, Selenium can handle Cookies Look for the definition of Cookies in Google, and in the meantime - You should know that NO, Selenium cannot handle Cookies 10. What a funny command: Webdriver...Should we stick to the 'driver' definition or that's not important and can be changed? WebDriver driver = new ChromeDriver(); Of course not, it is an integral part of Selenium Of course you can, it's only the name of an object No, since we initialize it to ChromeDriver Yes, since we initialize it to ChromeDriver Click SUBMIT to find out how you scored! Enter your E-mail address to receive the correct answers via mail. ***Your E-mail address will remain confidential. We will NOT spam, spy and we will NEVER share your information with any third parties. Email Time is Up! Time's up
where is the submit button 🙁
Hello Hanane,
Thank you for showing interest in this Selenium quiz! The submit button is right beneath the email field. Please reach out if you are still not able to locate it, I’d be happy to help 🙂
Thank you, i found it 🙂
Is there any way to see the correct answers ?