0

I am a newbie to Selenium. In Chrome, I am using a command to test if the xpath is correct or not.

Eg. $x("//input[@id='firstName']") or $x("//button[@name='Save']")

Sometimes, it is quite tough to verify that I am clicking the right icon or button, by running selenium command, which is annoying me..

Is there anything I can write to send(click) functions to the console, and that command does the action what I need (so that I can add it in my piece of code, so that I don't need to run selenium code each and every time.)

Thanks

Richard
  • 8,961
  • 3
  • 38
  • 47
ChanGan
  • 4,254
  • 11
  • 74
  • 135
  • I don't understand the question, but you might find [XPath Helper](https://chrome.google.com/webstore/detail/xpath-helper/hgimnogjllphhhkhlmebbmlgjoejdpjl) useful. – Alex Wittig Mar 11 '14 at 13:35
  • Simply, i wanted to do some actions (click some radio button or submit button by xpath) using console ... – ChanGan Mar 11 '14 at 13:38
  • 1
    There is no reliable way no. You can use the `click` methods from jQuery & JavaScript but that's not a representation of what Selenium will *actually* do. – Arran Mar 11 '14 at 15:38
  • @ChanGan, it sounds like you are using Selenium right now but would rather just type commands into the console *instead of* using Selenium. Is that right? – Alex Wittig Mar 11 '14 at 17:33

1 Answers1

0

Unless you have jquery or similar available, it doesn't look like there is a one-liner suited to the console.

See how to invoke click event from javascript.

Community
  • 1
  • 1
Alex Wittig
  • 2,800
  • 1
  • 33
  • 42