Help me to code css selector or xpath to click on this button using selenium webdriver.

classic Classic list List threaded Threaded
2 messages Options
sj
Reply | Threaded
Open this post in threaded view
|

Help me to code css selector or xpath to click on this button using selenium webdriver.

sj
I am learning selenium webdriver from the video u have posted and trying to click on the submit button , but the button does not have a id.  I don't know how to click on this button now, please help me.

        <form id="loginForm" action="/xyz/j_spring_security_check" method="POST" autocomplete="off">
           


                Sign In
           

            <div class="description">
                Enter your user name and password
            </div>
            <div>
                <label for="username">
                    User Name
                </label>
                <input name="j_username" id="username" tabindex="1" type="text">
                <label for="password">
                    Password
                </label>
                Reset Password
                <input name="j_password" id="password" tabindex="2" type="password">
                <input name="_action_Sign In" value="Sign In" class="submitbutton right" tabindex="3" type="submit">
                <div class="clear"> </div>
            </div>

        </form>

when i inspect the button, i see the above, can you please help to finish this code
driver.findElement(By.id("username")).sendKeys("admin");
driver.findElement(By.id("password")).sendKeys("password");
driver.findElement(By.cssSelector(???

Thanks
Note:  Ur selenium videos are so helpful.
Reply | Threaded
Open this post in threaded view
|

Re: Help me to code css selector or xpath to click on this button using selenium webdriver.

softwaretestingforum
Administrator
Please don't post "non training session" selenium question here.
They should be posted in this forum - http://www.seleniumtests.com/p/selenium-2-forum.html
~ seleniumtests.com