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
latim
Posts : 1
Join date : 2012-03-18

stored variable as an argument of uimap  Empty stored variable as an argument of uimap

Sun Mar 18, 2012 7:18 am
Hi all,

Being a newby in Selenium and new at the forum - I was trying to find similar problem discussed earlier here and, honestly, - no results. So seems I am not going to be a pain in the neck Smile

I have the following snippet of code in the IDE:

Code:
storeXpathCount | ui=empMngmt::gridRow() | empCount
....
  opening form, fulfilling fields and submitting - row is added to the grid
....
assertText | ui=empMngmt::gridCell(rowIdx=javascript{storedVars['empCount'] + 1}, colName=firstName) | SomeName |


by executing the first line - I am storing number of rows in a grid to the empCount variable - it works fine. And let say the empCount holds now 8.
by executing the last line - I am trying to assert if the expected value is displayed in a grid cell from the just added row (empCount + 1). The grid cell locator is defined in an ui map and ...
... the problem is that the
Code:
javascript{storedVars['empCount'] + 1}
is not actually recognized as javasript. The UI-Element tab shows:

current specifier maps to locator:
//div[@class="datagrid-body"]/table[javascript{storedVars['empCount'] + 1}]/tbody/tr/td[@field="firstName"]/div

when I need it to be

//div[@class="datagrid-body"]/table[9]/tbody/tr/td[@field="firstName"]/div

The question is - how to use an arithmetic operation with stored variables in ui-map's arguments?

Great thanks in advance!
Back to top
Permissions in this forum:
You cannot reply to topics in this forum