Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Element not found when executing findElement in Selenium

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how I'm going to explain this, but I'll give it my best

I'm trying to fill in multiple forms that come after eachother, all the forms get filled swiftly with no errors because I make sure to add

       

before doing anything on a new page, and I know I'm on the correct page.

On the last form, I encounter this error :



So I went to check on the browser by taking a screenshot and the browser is on the correct page with the correct form, I also checked the xpath values and even tried other attributes.. nothing seemed to work.

So I went ahead and printed out the PageSource which showed a totally different page (not the previous page), I also noticed the this page flashed for a second before the final form appeared..

I also tried but that didn't work.. I kept searching and looking but nothing appeared. I also changed browsers, that did nothing..

This is the method im trying to execute:


Edit:

More Information:

Here's the form screenshot: Form Screenshot

Here's the result of executing the following lines:

Code:


Result: The form but in text

Code:



Result: A different page


Code:

Result: Same as the previous one.. different page..

I've been stuck for 10 hours on this, I really need a solution
 
Master Rancher
Posts: 4663
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What browser are you pretending to be?
Because that page seems to have a browser check.
 
Jake Martins
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:What browser are you pretending to be?
Because that page seems to have a browser check.



I'm not pretending to be a browser, as Selenium uses real browsers and controls them. Tried Firefox and Chrome
 
Dave Tolls
Master Rancher
Posts: 4663
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't expect you're able to see the request that goes out to get that page?
Are you able to duplicate the issue in the browser directly (preferably with the dev tools open so you can check the network traffic)?
 
Jake Martins
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:I don't expect you're able to see the request that goes out to get that page?
Are you able to duplicate the issue in the browser directly (preferably with the dev tools open so you can check the network traffic)?



Thank you for the reply,

I just tried to fill the form manually and checked the View Source of the form.. it returned something totally different than the form
Here's the page source produced by the form: https://pastebin.com/Kv15V2SK

Here's a screenshot of the inspect element of the page: http://prntscr.com/qvi6hc

Here's a screenshot of the form:
 
Dave Tolls
Master Rancher
Posts: 4663
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't see any of that lot here, I'm afraid.
 
Jake Martins
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:I can't see any of that lot here, I'm afraid.



Why can't you ?

how can i send them to you to view?
 
Dave Tolls
Master Rancher
Posts: 4663
49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't.
Stuff hosted outside of here is quite often not visible to those of us behind corporate firewalls.

It's why we suggest copy pasting.
 
Jake Martins
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:You can't.
Stuff hosted outside of here is quite often not visible to those of us behind corporate firewalls.

It's why we suggest copy pasting.



I understand.

Here's the page source:


It appears that the website is blocked selenium on that specific page, i think its Invisible Captcha..
The previous page had image captcha which i solved with this method:


Is there a way I could change in that method to solve the invisible captcha?

BTW, thank you so much for your replies
 
Ranch Hand
Posts: 459
6
Netbeans IDE Oracle Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your element may be invisible or may not be in view-port or may have a property top, left, right or other 0.

Do you have a ajax call?

Try to inspect the properties for that element.



 
    Bookmark Topic Watch Topic
  • New Topic