0
    [ERROR - 2015-11-26T10:17:14.013Z] Session [9dd2e3a0-9426-11e5-986e-45afd4903e2f] - page.onError - msg: TypeError: null is not an object (evaluating 'a.getElementById("ButtonID").addEventListener')

  :262 in error
[ERROR - 2015-11-26T10:17:14.016Z] Session [9dd2e3a0-9426-11e5-986e-45afd4903e2f] - page.onError - stack:
  (anonymous function) (http://c.supert.ag/digitouch-dijital-pazarlama/biletix/supertag-code-v30.js:9)
  fireTag (http://c.supert.ag/digitouch-dijital-pazarlama/biletix/supertag-code-v30.js:9)
  fireBaseContainer (http://c.supert.ag/digitouch-dijital-pazarlama/biletix/supertag-code-v30.js:9)
  t (http://c.supert.ag/digitouch-dijital-pazarlama/biletix/supertag-code-v30.js:9)
  (anonymous function) (http://c.supert.ag/digitouch-dijital-pazarlama/biletix/supertag-code-v30.js:9)

  :262 in error

I am visiting this page after clicking a region from right, for each event name there, in a while loop i go to that links and take event dates- hours from there.

http://www.biletix.com/search/TURKIYE/en#!date_sb:today

But it gave the error i wrote at the beginning, after 6. or 7. page. But despite that error, it can give what i want, name date and hour.

I use this at first page to wait to be clicked.(for clicking region):

new WebDriverWait(driver, 120).until(
        ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@id=\"mpcat_zones\"]/div[2]/ul/li[2]/a"))).click();

After that, i use this to wait until loading the elements i wanted:

 new WebDriverWait(driver, 120).until(
            ExpectedConditions.presenceOfElementLocated(By.id("all_result")));

That is driver. I did not define any options, capabilities:

file = new File("lib/phantomjs-2.0.0-windows/bin/phantomjs.exe");   
        System.setProperty("phantomjs.binary.path", file.getAbsolutePath());
        driver = new PhantomJSDriver();
    driver.get(biletixURL);

The error occurs always at same place. Before giving output of that page

http://www.biletix.com/etkinlik/SSD50/TURKIYE/en

And sometimes, it gave error of element not found, gave up. stop And can not load or give output anything. But i created a explicit wait, i gave code of it.

And after explicit wait, i get the source.

Just executed and immediately it closed after that error:

    [ERROR - 2015-11-26T11:17:46.905Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1448536666506

  :262 in error
[ERROR - 2015-11-26T11:17:48.241Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1448536668217

  :262 in error
[ERROR - 2015-11-26T11:17:49.221Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1448536669166

  :262 in error
[ERROR - 2015-11-26T11:17:51.552Z] Session [5192ff30-942f-11e5-90e2-3ba3937b2cfc] - page.onError - msg: TypeError: null is not an object (evaluating 'filterStartDate.toString')

  :262 in error
[ERROR - 2015-11-26T11:17:51.554Z] Session [5192ff30-942f-11e5-90e2-3ba3937b2cfc] - page.onError - stack:
  getDateIntervalFilter (http://www.biletix.com/scripts/search.js?v=:1033)
  initQuery (http://www.biletix.com/scripts/search.js?v=:571)
  doRegionFilter (http://www.biletix.com/scripts/search.js?v=:1049)
  dispatchEvent (:0)
  U (phantomjs://webpage.evaluate():119)
  $ (phantomjs://webpage.evaluate():108)
  $ (phantomjs://webpage.evaluate():101)
  gh (phantomjs://webpage.evaluate():141)
  sh (phantomjs://webpage.evaluate():152)
  (anonymous function) (phantomjs://webpage.evaluate():152)
  (anonymous function) (phantomjs://webpage.evaluate():152)
  (anonymous function) (phantomjs://webpage.evaluate():153)

  :262 in error

I am using Java and eclipse and Selenium. I dont understand why it cant load the page and cant find element sometimes, despite wait time.

Basic scenearia is:

  1. Navigate to first page.
  2. Click and choose a region with phantomjs
  3. Get all page source and after regex pattern matching (to get names and urls), go that urls in a while loop of match()
  4. At that page, get only hour (i already took name and date in previous page after clicked via regex)
  5. Give output to console for each process in while loop.
  6. driver.close () or driver.quit()

1 Answer 1

0

Do you use this dependency in your code? I wonder if using this dependency might help? Yes, use phantomjsdriver 1.2.1 with phantomjs binary 2.0.0.

<dependency>
    <groupId>com.codeborne</groupId>
    <artifactId>phantomjsdriver</artifactId>
    <version>1.2.1</version>
</dependency>

Not the answer you're looking for? Browse other questions tagged or ask your own question.