[IDE] Combine Multiple commands into one

18 views
Skip to first unread message

stefan.lo...@gmail.com

unread,
Oct 17, 2017, 6:28:03 AM10/17/17
to Selenium Users
I wanted to combine multiple commands into one command, that takes in 2 parameters and performs some actions. However, using user-extentions I`m facing some issues since it does not wait for the pages to load properly. Here are the lines I want to combine into 1:


The extention I wrote looks like this:

this.doOpen("https://gauth.apps.gbraad.nl/");

this.makePageLoadCondition(30);

var element = this.browserbot.findElement("//p[contains(.,'" + account + "')]//preceding::h3[1]");

var key = core.text.getElementText(element);

LOG.debug("Key: " + key);

this.doOpen("/Account/Login");

this.makePageLoadCondition(30);

this.doType("//*[@id='Email']", account);

var usernameField = this.browserbot.findElement("//*[@id='Email']");

var passwordField = this.browserbot.findElement("//*[@id='Password']");

core.events.setValue(usernameField, account);

core.events.setValue(passwordField, password);

this.doClick("//button[contains(.,'Sign In')]");


I keep getting the error that it can not find the element, since the page is not loaded yet. Any Ideas?

Reply all
Reply to author
Forward
0 new messages