[Solved] How to create and write a module for automation test framework

Just go with page object model. It’s simple only. Refer this link. http://toolsqa.com/selenium-webdriver/page-object-pattern-model-page-factory/ Ex: Keep Header.java and Move the locator elements to Header.java Similarly Catergory.java and Move the locator elements to Category.java Then SampleTest.java, Call the locator method in the test file…. That’s all……. solved How to create and write a module for automation test … Read more

[Solved] how to scrape web page that is not written directly using HTML, but is auto-generated using JavaScript? [closed]

Run this script and I suppose it will give you everything the table contains including a csv output. import csv from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as EC driver = webdriver.Chrome() wait = WebDriverWait(driver, 10) outfile = open(‘table_data.csv’,’w’,newline=””) writer = csv.writer(outfile) driver.get(“http://washingtonmonthly.com/college_guide?ranking=2016-rankings-national-universities”) wait.until(EC.frame_to_be_available_and_switch_to_it(“iFrameResizer0”)) wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, ‘table.tablesaw’))) … Read more

[Solved] When I run test in selenium using java, the alert gets closed but in code it shows failure

According to you, you are able to accept the alert but test step is showing exception in console : You can catch the exception and proceed further with your next steps: Below is the code : try { Alert myAlert = driver.switchTo().alert(); myAlert.accept(); } catch (Exception e) { System.out.println(“######### Successfully Accepted Alert ################”); } // … Read more

[Solved] How to create Gmail account using Selenium, I am having trouble with month and country drop downs

As I see at here the month drop down box is not actually a select element, you should try using Actions as below: WebDriverWait wait = new WebDriverWait(d, 10); Actions builder = new Actions(d); WebElement selectMonth = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(“//div[@title=”Birthday”]”))); builder.mouse.mouseMove(((Locatable)selectMonth).coordinates); selectMonth.click(); WebElement option = wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath(“//div[text() = ‘May’]”))); builder.mouse.mouseMove(((Locatable)option).coordinates); option.click(); System.out.println(“may slected…”); Edited: if you want to … Read more