OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How do I click on next button on Selenium?

  • Thread starter Thread starter Kakashi hatake
  • Start date Start date
K

Kakashi hatake

Guest
Site in question: talent.capgemini.com. I have created below code but my code is unable to click on next icon

Code:
from selenium import webdriver
from selenium.webdriver.edge.service import Service
from selenium.webdriver.common.by import By
import time

#test escapese
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


# Specify the path to msedgedriver.exe
edge_path = 'C:\\pycharm folder\\msedgedriver.exe'

# Create a service object
service = Service(executable_path=edge_path)

# Initialize the Edge WebDriver using the service
driver = webdriver.Edge(service=service)

# Open the Talent SSO page
driver.get("https://talent.capgemini.com/")

# Find the input field
element = driver.find_element(By.ID, "identifierInput")

# Enter the text "Guess Who" into the input field
element.send_keys("Guess Who")


# Find the "Next" button and click on it
next_button = driver.find_element(By.CSS_SELECTOR, "/html[1]/body[1]/div[1]/div[2]/form[1]/div[3]/a[1]")
#next_button.click()








input("Press Enter to close the browser...")

I get an error:

Code:
line 31, in <module>
    next_button = driver.find_element(By.CSS_SELECTOR, "/html[1]/body[1]/div[1]/div[2]/form[1]/div[3]/a[1]")
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<p>Site in question: talent.capgemini.com. I have created below code but my code is unable to click on next icon</p>
<pre><code>from selenium import webdriver
from selenium.webdriver.edge.service import Service
from selenium.webdriver.common.by import By
import time

#test escapese
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


# Specify the path to msedgedriver.exe
edge_path = 'C:\\pycharm folder\\msedgedriver.exe'

# Create a service object
service = Service(executable_path=edge_path)

# Initialize the Edge WebDriver using the service
driver = webdriver.Edge(service=service)

# Open the Talent SSO page
driver.get("https://talent.capgemini.com/")

# Find the input field
element = driver.find_element(By.ID, "identifierInput")

# Enter the text "Guess Who" into the input field
element.send_keys("Guess Who")


# Find the "Next" button and click on it
next_button = driver.find_element(By.CSS_SELECTOR, "/html[1]/body[1]/div[1]/div[2]/form[1]/div[3]/a[1]")
#next_button.click()








input("Press Enter to close the browser...")
</code></pre>
<p>I get an error:</p>
<pre><code>line 31, in <module>
next_button = driver.find_element(By.CSS_SELECTOR, "/html[1]/body[1]/div[1]/div[2]/form[1]/div[3]/a[1]")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
</code></pre>
 

Latest posts

Top