// small example to demonstrate working with selenium webdriver and drop downs
package selenium.dropdowns;import java.util.Iterator;import java.util.List;import org.openqa.selenium.By;import org.openqa.selenium.WebElement;import org.openqa.selenium.chrome.ChromeDriver;import org.openqa.selenium.support.ui.Select;public class dd { public static void main(String[] args) throws InterruptedException { System.setProperty("webdriver.chrome.driver", "C:\\Users\\shama.ugale\\Downloads\\chromedriver.exe"); ChromeDriver driver= new ChromeDriver(); driver.get("https://www.commonfloor.com/agent/login?show_signup=1"); WebElement cityDD=driver.findElement(By.id("city")); ///////// use case 1 - select any elem in the dd Select sec= new Select(cityDD); sec.selectByIndex(45); Thread.sleep(2000); // this is the value attribute of the option element under ur dropdown sec.selectByValue("Ghaziabad"); Thread.sleep(2000); sec.selectByVisibleText("Pune"); ///////////// use case 2 -- fetch all the dd elements List<WebElement> cities= sec.getOptions(); Iterator<WebElement> it= cities.iterator(); while(it.hasNext()){ WebElement elem= it.next(); System.out.println(elem.getText()); } //////////////// use case 3 --- size of the elements System.out.println("No of cities : " + cities.size()); /////////////// use case 4 -- fetch wats selected in the dd String selectedValue=sec.getFirstSelectedOption().getText(); System.out.println("Selected option : "+ selectedValue); }}
Selenium Framework Training in Chennai
ReplyDeleteReach @ 8122241286 or 9003085882
http://thecreatingexperts.com/selenium-training-in-chennai/
Best in Class Advanced Selenium Framework based Training in Chennai with live project EXP.
Great post. I am actually getting ready to across this information, its very helpful for this blog. Also great with all of the valuable information you have keep up the good work you are doing well. Selenium Training in Chennai
ReplyDeleteHello Shama,
ReplyDeleteThe Article on Working with Dropdowns with selenium
is nice give detail information about it.Thanks for Sharing the information about Testing with Selenium Software Testing Company
Its a nice post.
ReplyDeleteBest Oracle Training in Bangalore
Great information it's very useful for freshers. I read your blog completely I gather lot of information in this blog.It will help me to analyses lot of information about selenium. Thank you for sharing!
ReplyDeleteBest Selenium Training in chennai
Thanks for sharing such a valuable information. It was very nice and also informative. Keep giving like this.
ReplyDeleteBest Data Science Online Training Institute In Hyderabad
Awesome blog. It was very informative. I would like to appreciate you. Keep updated like this best selenium training institute in hyderabad
ReplyDeleteThanks for splitting your comprehension with us. It’s really useful to me & I hope it helps the people who in need of this vital information... Java Training in Chennai | Blue prism Training in Chennai
ReplyDeleteIt is a wonderful data you offered to us I really enjoy by reading your article.
ReplyDeleteSelenium Training in Chennai
JAVA Training in Chennai
Big Data Training in Chennai
Hadoop Training in Chennai
iOS Training in Chennai
Selenium Courses in Chennai
feeling so good to read your information's in the blog.
ReplyDeletethanks for sharing your ideas with us and add more info.
Cloud computing Training institutes in Bangalore
Cloud Computing Training in Perambur
Cloud Computing Training in Nungambakkam
Cloud Computing Training in Karapakkam
I really enjoy the blog.Much thanks again. Really Great.
ReplyDeleteCCNA Training in Vadapalani
CCNA Course in Tambaram
CCNA Course in Kodambakkam
CCNA Training in Aminjikarai
CCNA Course in Chennai Kodambakkam
I liked your blog.Thanks for your interest in sharing your ideas.keep doing more.
ReplyDeleteSpoken English Course in Anna Nagar
Spoken English Classes in Koyambedu
Spoken English in Perambur
Spoken English Classes near Anna Nagar
Best Spoken English Classes in Anna Nagar
Spoken English Classes in Arumbakkam
Spoken English Classes near me
Wonderful post. Thanks for taking time to share this information with us.
ReplyDeleteccna Training institute in Chennai
ccna institute in Chennai
ccna Training center in Chennai
DevOps course in Chennai
Robotics Process Automation Training in Chennai
AWS Training in Chennai
ReplyDeleteAmazing Post. It shows your great understanding of the concept. Thanks for Sharing.
IELTS coaching in Chennai
IELTS Training in Chennai
IELTS coaching centre in Chennai
Best IELTS coaching in Chennai
IELTS classes in Chennai
Best IELTS coaching centres in Chennai
IELTS Centre in Chennai
IELTS Training
IELTS Course in Chennai
Wonderful piece of work. Master stroke. I have become a fan of your words. Pls keep on writing.
ReplyDeleteDrupal Training in Chennai
Drupal Software
Drupal Training
Drupal 8 Training
Drupal Classes
Drupal 7 Training
Drupal Certification Training
Drupal Training Course
Drupal 7 Certification
ReplyDeleteExtra-ordinary. The way you narrate the post makes it a exemplorary piece of work. Pls Keep writing.
Tableau Training in Chennai
Tableau Course in Chennai
Tableau Certification in Chennai
Tableau Training Institutes in Chennai
Tableau Certification
Tableau Training
Tableau Course
Nice post..
ReplyDeleterobotics courses in Marathahalli
robotic process automation training in Marathahalli
blue prism training in Marathahalli
rpa training in Marathahalli
automation anywhere training in Marathahalli
WOW! Really Nice Post! I personally believe that to maintain the standard of a blog all the hacks mentioned above are important. All points discussed were worth reading
ReplyDeleteand I’ll surely work with them all one by one.
CEH Training In Hyderbad
hi thanku so much this information
ReplyDeletecs executive
freecseetvideolectures/
Really a good post, thanks for sharing .keep it up.
ReplyDeleteJewellery ERP Software Dubai
Jewellery ERP Software Dubai
Really a good post, thanks for sharing .keep it up.
ReplyDeleteJewellery Software
Jewellery Software