Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Hi!. Script Started")
- # code to load webpage, automatically fill whatever can be entered
- x = input("Waiting for manual date to be entered. Enter YES when done.")
- # Enter the data on page manually. Then come back to terminal and type YES and then press enter.
- if x == 'YES':
- continue_script_here()
- else:
- kill_script_or_something_else()
- WebDriverWait wait = new WebDriverWait(driver, 100);
- //whatever time you think is sufficient for manually entering the data.
- WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id(>someid>)));
- if(ExpectedConditions.attributeToBeNotEmpty(element,"value"))
- {
- //continue with the automation flow
- }
- driver.findElement(By.cssSelector("body")).sendKeys(Keys.CONTROL +"t");
- driver.switchTo().defaultContent();
- for(int i =1;i>0;i++)
- {
- ArrayList<String> tabs = new ArrayList<String>(driver.getWindowHandles());
- if(tabs.size()==2)
- {
- //keep checking for the point when the number of tabs becomes 1 again.
- continue;
- }
- else
- {
- break;
- }
- }
- //your rest of the automation code
Add Comment
Please, Sign In to add comment