Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
eyekyu
Posts : 3
Join date : 2011-07-05

Please help.. cant figure out variable! Empty Please help.. cant figure out variable!

Tue Jul 05, 2011 4:37 am
Love Selenium IDE.... theres just one thing i cant figure out.... ive been using it to Find and click a reference on a page... it is a clickable button with text that reads "Pay $12,098 to Fix it quick!" im using the "Clickandwait" command....

My line in selenium looks like //input[@value='Pay $12,098 to Fix it quick!']

the problem is... the number is different every time... sometimes it might just be $6,849 or it could be up to $184,212

so what I need is a way for selenium to always click that button.. no matter what the money value is.... can someone please help me!

avatar
Arthur
Active particpant
Active particpant
Posts : 23
Join date : 2011-05-23
Location : Pune

Please help.. cant figure out variable! Empty Re: Please help.. cant figure out variable!

Tue Jul 05, 2011 2:06 pm
Hi,

You can use
globs, exact and regular expressions when the data is dynamic.

Code:
glob: Pay $* to Fix it quick!

If this doesn't work use
if fire bugs xpath to link is following
Code:
sel.click("//*[@id='link-icon-unknown-vir_full']")
then you can use to click the same.
Code:
sel.click("//*[contains(@id,'link')]")
If fail to do with this then give example of code where you want to click.

Thanks
avatar
eyekyu
Posts : 3
Join date : 2011-07-05

Please help.. cant figure out variable! Empty Re: Please help.. cant figure out variable!

Tue Jul 05, 2011 9:31 pm
great.. thanx for the help.. but where do i actually put that code that you gave me...? i have no idea how to incorporate it.
avatar
eyekyu
Posts : 3
Join date : 2011-07-05

Please help.. cant figure out variable! Empty Re: Please help.. cant figure out variable!

Wed Jul 06, 2011 4:16 am
heres a piece of the code

Code:
<form action="/isolation" method="post">
                        <input type="hidden" name="cmd" value="bribeout">

                          <h1>Bribe Out</h1>
                        <p align="center"><input type="submit" class="button" value="Pay $9,900 to Fix it Quick!"></p>
                        </form>

Sponsored content

Please help.. cant figure out variable! Empty Re: Please help.. cant figure out variable!

Back to top
Permissions in this forum:
You cannot reply to topics in this forum