Below is the node.js program I wrote:
var webdriver = require("selenium-webdriver");
function createDriver() {
var driver = new webdriver.Builder()
.usingServer('http://localhost:4444/wd/hub')
.withCapabilities(webdriver.Capabilities.chrome())
.build();
driver.manage().timeouts().setScriptTimeout(900000);
return driver;
}
var driver = createDriver();
driver.get('https:webpage-url');
driver.findElement(webdriver.By.name('USERNAME')).sendKeys('abcd');
driver.findElement(webdriver.By.name('PASSWORD')).sendKeys('pswd');
driver.findElement(webdriver.By.id('button')).click();
driver.findElement(webdriver.By.name('ABCD')).sendKeys('abcd');
driver.findElement(webdriver.By.id('button')).click();
driver.findElement(webdriver.By.name('DEPRT')).sendKeys('DEPT)');
driver.findElement(webdriver.By.id('abutton')).click();
driver.manage().timeouts().implicitlyWait(1000000);
driver.switchTo().defaultContent();
driver.switchTo().frame("frameid");
driver.findElement(webdriver.By.id('pbutton')).click();
I attempted to use the implicitlyWait function before calling the frame element, however it did not wait and the NoSuchFrameError error occurred.
I also tried using only driver.wait(10000) before calling the iframe element, but it resulted in a timeout instead of completing the remaining steps. Any assistance on this matter would be appreciated.