question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hey,

I was wondering if the syntax of the prescript in the documentation is still correct. When I follow the guidelines at seleniumhq it looks very different.

I am using the following code:

module.exports = {
  run(context) {
    return context.runWithDriver((driver) => {
        return driver.get('https://********')
                .then(() => {
                        var webdriver = context.webdriver,
                        By = webdriver.By,
                        until = webdriver.until;
                        
                        var driver = new webdriver.Builder()
                            .forBrowser('chrome')
                            .build();

                        var form = driver.findElement(By.name('******'));
                        driver.findElement(By.id('username')).sendKeys('*****');
                        driver.findElement(By.id('password')).sendKeys('*****');
                        form.submit();
                        driver.wait(until.elementIsVisible(driver.findElement(By.name('**********'))), 5000);
                        
                        var iklForm = driver.findElement(By.name('*********'));
                        driver.findElement(By.name('**********')).sendKeys('11269483');
                        iklForm.submit();

                        driver.wait(until.elementIsVisible(driver.findElement(By.id('************'))));
                        driver.findElement(By.linkText('**********')).click();
                        return true;
                        })
                })
        }
}

I am constantly getting:

TypeError: Cannot read property ‘elementIsVisible’ of undefined at driver.get.then (/sitespeed.io/prescript.js:15:30)

But as I can see, webdriver should be defined…

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
soulgalorecommented, Apr 24, 2017

Let me spend some time tonight and make the documentation easier to understand and add more examples.

0reactions
cambiphcommented, Apr 24, 2017

Thank you for the fast and clear response. The script is working now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Linguistic prescription - Wikipedia
Linguistic prescription, or prescriptive grammar, is the establishment of rules defining preferred usage of language. ... These rules may address such linguistic ...
Read more >
Writing pre-request scripts - Postman Learning Center
You can use pre-request scripts in Postman to execute JavaScript before a request runs. By including code in the Pre-request Script tab for ......
Read more >
Common Prescription Abbreviations and Meanings
Doctors use prescription shorthand to communicate with the pharmacist who will fill your order. But, unless you know Latin well enough to understand...
Read more >
`.gitlab-ci.yml` keyword reference - GitLab Docs
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >
ZBNF-Main Description - vishia
syntax -prescript is a String-sequence, which defines any syntax in ZBNF. A syntax-prescript is the right part of a syntax-definition after the ::=...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found