I'm having a problem that I'm not sure how to solve. I have a customer code on one page (ex. Test095). I store it as var1. And I have to navigate to another page and verify that the code is the same. But on the second page the customer code looks like this : Customer Code: Test095. I store is as var2. So I have to remove Customer Code words from here , so I can verify that var1 equals var2. How can I get rid of Customer Code words?
open |www.link.com
verify title | Page
assert text| css=tr:child(1)-example | Test095
store | css=tr:child(1)-example | var1
open |www.anotherlik.com
assert text| xpath = //div[#id='myform']/div/div/p[4] | Customer code: Test095
store|xpath = //div[#id='myform']/div/div/p[4] |var2
verify| var2 | ${var1}
use java inbuit replace() function for string. Its better also to use trim incase to remove whitespaces
String s = "Customer Code: Test095";
s = s.replace("Customer Code:","").trim();
System.out.println(s);
To make this work in Selenium IDE
use command 'execute script', as i used in screenshot below
Here 'y' will store value Test095
Related
I have the following query which provides me with all the data I need exported but I would like text '' removed from my final query. How would I achieve this?
| where type == "microsoft.security/assessments"
| project id = tostring(id),
Vulnerabilities = properties.metadata.description,
Severity = properties.metadata.severity,
Remediations = properties.metadata.remediationDescription
| parse kind=regex id with '/virtualMachines/' Name '/providers/'
| where isnotempty(Name)
| project Name, Severity, Vulnerabilities, Remediations ```
You could use replace_string() (https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/replace-string-function) to replace any substring with an empty string
I created a message class which contains the following text
No K&C Data available for &1
DATA ls_return TYPE bapiret2.
DATA lv_par1 TYPE sy-msgv1 .
lv_par1 = '123456' .
CALL FUNCTION 'BALW_BAPIRETURN_GET2'
EXPORTING
type = 'I'
cl = 'Z_MY_MESSAGE_CLASS'
number = 021
par1 = lv_par1
IMPORTING
return = ls_return.
WRITE ls_return-message .
The output of the small example programm will be
No K123456C Data available for 123456
but should be
No K&C Data available for 123456
So how do I escape(?) or change the entry of my message class?
You need use it as couple like below:
No K&&C Data available for &1
I have a textbox named "Search" and code that filters a customer out by name. I also want to display the whole table if the textbox is empty but don't know how to do it.
NOTE : I am using Microsoft Access.
Here is my code :
SELECT * FROM Customers
WHERE Forms.[Form1].[Text4] = Forms.[Form1].[Text4] AND FirstName=Forms.[Form1].[Text4];
Thank you for any help.
You need validate if text is empty or filter to another rules, this can be something like this:
SELECT * FROM Customers WHERE Forms.[Form1].[Text4] IS NULL OR FirstName = Forms.[Form1].[Text4];
So i'm working on a laravel project where i pass some data to matlab and then matlab will edit them..everything works fine except the function of matlab that i wrote..
function show(a)
econ=database('datamining','root','');
curs=exec(con,'SELECT name FROM dataset_choices WHERE id = a');
curs = fetch(curs);
curs.Data
end
i want this function to display the name of the dataset the user choose..the problem is that it doesnt work writing just where id = a... but if i write for example where id=1 it works..
i tried to display just the a with disp(a) to see what is the value of the a and it is store the right id that user had choose..so how can i use it in my query??
Try:
a = num2str(a); % or make sure the user inputs a string instead
curs=exec(con,['SELECT name FROM dataset_choices WHERE id = ',a]);
If a = '1', then the brackets would print:
'SELECT name FROM dataset_choices WHERE id = 1'
I'm trying to query the Oracle v$session table using Groovy (imported groovy.sql.SQL) like this:
sql.eachRow("""
Select
'Y' as runInd
from v$session
where upper(module) = ?
having count(*) > 1
""", [programName]) {row -> etc...}
But Groovy keeps telling me: "Groovy:Apparent variable 'session' was found in a static scope but doesn't refer to a local variable, static field or class."
It apparently doesn't like the table called v$session. I've tried many things, I'm not sure why I can't find out how to do this. Any help is appreciated. Thanks!
Tom
Instead of """ which marks it as a multi-line templated groovy string, try ''' which shouldn't try to template things following a $:
sql.eachRow( '''Select
| 'Y' as runInd
| from v$session
| where upper(module) = ?
| having count(*) > 1'''.stripMargin(), [programName]) { row ->
etc...
}