Posts

Showing posts with the label Selenium 3

Selenium Interview Questions and Answers

Listing down some of the links for Interview questions and answers for Selenium webdriver Please feel free to add more under the comments. 1. http://www.techbeamers.com/category/interview-questions/selenium-interview/ 2. https://www.linkedin.com/pulse/selenium-real-time-interview-questions-answers-technologies-13600- 3. https://intellipaat.com/interview-question/selenium-interview-questions/

Practice sites for Selenium

I know most of the people who are new to Selenium are looking for sites to practice selenium which have all kinds of scenarios such as hovering, multi-level hovering, drag and drop , resizable text fields multi select drop downs, frames, multiple windows and so on. My suggestion is to automate anything that you would see or do day in day out to practice or to help you in your regular repeated work ;) For example, automate your timesheets (great time saver , isn't it + its pretty boring ;) ,no offence though). But,i thought i would share what i have found so far. Below are some of them, please feel free to suggest more in the comments. 1. http://www.seleniumframework.com/demo-sites/ 2. http://store.demoqa.com 3. http://demoqa.com 4. http://toolsqa.com/automation-practice-form/ 5. http://toolsqa.com/automation-practice-switch-windows/ 6. http://toolsqa.com/automation-practice-table/ 7. http://toolsqa.com/handling-alerts-using-selenium-web...

Highlighting WebElement in Selenium

We can highlight the WebElements under action during the execution to help capture them while failure analysis. It can be done using the below code. Have the utility function in for framework ,use it for all the actions performed at the framework level. See the sample below. Function to highlight the WebElement under execution: public static void elementHighlight(WebElement element ) { JavascriptExecutor js = (JavascriptExecutor) driver ; js .executeScript( "arguments[0].setAttribute('style',arguments[1]); , element , "color: red; border: 3px solid red;" ); } Use it as below, used in the plain function here, you need to embed it in your framework as to highlight all the elements under action. public static void main(String[] args ) throws InterruptedException {         System.setProperty( "webdriver.gecko.driver" , "Path to geckodriver" ); driver = new FirefoxDriver(); driver .get( ...