Issue with variable values in selenium grid execution - python-2.7

We are using selenium grid to all UI testcases.
We are facing issue when any variable having value 1 which is getting entered into any text field.
e.g.
set test variable ${data} 1
input text ${data}
if a variable has value set to 1 but below value is getting set:
/tmp/21fe989d-6c5d-413b-8365-cf6da42e92b9/upload957182740231871694file/1
Due to this testcases are failing as text field expectes int but it gets above value.
I am not sure from where "/tmp/21fe989d-6c5d-413b-8365-cf6da42e92b9/upload957182740231871694file/" this part is getting appended to the variable value.
This is strage as it happens only when value is 1.
Below is the detail log from test exection:
16:56:00.882 INFO Typing text '1' into text field 'xpath=//input[#name='floorValue']'
16:56:00.883 DEBUG POST http://192.168.1.201:4444/wd/hub/session/e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e/elements {"using": "xpath", "sessionId": "e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e", "value": "//input[#name='floorValue']"}
16:56:00.905 DEBUG Finished Request
16:56:00.905 DEBUG POST http://192.168.1.201:4444/wd/hub/session/e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e/element/26/clear {"sessionId": "e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e", "id": "26"}
16:56:00.931 DEBUG Finished Request
16:56:00.933 DEBUG POST http://192.168.1.201:4444/wd/hub/session/e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e/file {"sessionId": "e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e", "id": "26", "file": "UEsDBBQAAAAIAGJU9Uhr90YTkgoAAF5CAAABAAAAMe1bbW/bOBL+HP8Kwf5g+dZRGvd6iwtOi3Ob\n9tBDui2SvuCQBAQtMTa7suQVqdTeX398lUhJfpHk7uWA+kMiUjMPh8OZ4QwlDR7SZOkEyXKZxCCj\nOMIUI+JdYUIvIYUOXq6SlDq63asnX6BohVJNnCIY0iTEAZXkaTJLqBfhWQpTTv0ywxF9G2ty1ezl\n3PqK0BTH87wfxmGy1C2KlzldQnKOTX4ZQooEkRBBt5yD747FECGK9KTlLOAKa6oomc9RKm/eoAjF\nOF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jG4/vgSFFR3lwhG\nRP4FfAggxvDomvIXRsTQ3oN4ZczFcRBl/I1Cnrn4w+s3/+bqZ+uVRdTxHUmbZrGbZJQpwD+GYHeU\nyeStlxGTprdNZddChC8pG5+py2wdRTmGDN43DgvknInLjS2l/vBogyzoMhqOo2R+HEwGJCFH0hr/\nC1BLAQIUAxQAAAAIAGJU9Uhr90YTkgoAAF5CAAABAAAAAAAAAAAAAACkgQAAAAAxUEsFBgAAAAAB\nAAEALwAAALEKAAAAAA==\n"}
16:56:00.943 DEBUG Finished Request
16:56:00.944 DEBUG POST http://192.168.1.201:4444/wd/hub/session/e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e/element/26/value {"sessionId": "e8d83ee3-7a75-40cd-a079-bb2c83d6fb2e", "id": "26", "value": ["/", "t", "m", "p", "/", "e", "8", "d", "8", "3", "e", "e", "3", "-", "7", "a", "7", "5", "-", "4", "0", "c", "d", "-", "a", "0", "7", "9", "-", "b", "b", "2", "c", "8", "3", "d", "6", "f", "b", "2", "e", "/", "u", "p", "l", "o", "a", "d", "6", "0", "5", "4", "3", "8", "4", "5", "8", "0", "2", "8", "1", "8", "0", "7", "9", "3", "f", "i", "l", "e", "/", "1"]}"

Related

Faceting a Layered Plot Vega-Lite Deneb

wonder if you could help me out on the below.
I´m using Deneb to visualize small multiples in PBI and I´m not able to find out how to add text labels above/below the bar.
Does anyone know the workaround by chance?
Here´s the code that I´m using so far:
{
"data": {"values": [
{"Region":"A","Month":"1","Difference":"-0.01"},
{"Region":"A","Month":"2","Difference":"0"},
{"Region":"A","Month":"3","Difference":"-0.03"},
{"Region":"A","Month":"4","Difference":"-0.01"},
{"Region":"A","Month":"5","Difference":"-0.01"},
{"Region":"A","Month":"6","Difference":"0.05"},
{"Region":"A","Month":"7","Difference":"-0.05"},
{"Region":"A","Month":"8","Difference":"-0.03"},
{"Region":"A","Month":"9","Difference":"0.03"},
{"Region":"A","Month":"10","Difference":"-0.01"},
{"Region":"A","Month":"11","Difference":"-0.01"},
{"Region":"A","Month":"12","Difference":"0.03"},
{"Region":"B","Month":"1","Difference":"-0.02"},
{"Region":"B","Month":"2","Difference":"-0.02"},
{"Region":"B","Month":"3","Difference":"0.02"},
{"Region":"B","Month":"4","Difference":"0.03"},
{"Region":"B","Month":"5","Difference":"-0.05"},
{"Region":"B","Month":"6","Difference":"-0.02"},
{"Region":"B","Month":"7","Difference":"-0.01"},
{"Region":"B","Month":"8","Difference":"0.03"},
{"Region":"B","Month":"9","Difference":"-0.03"},
{"Region":"B","Month":"10","Difference":"-0.03"},
{"Region":"B","Month":"11","Difference":"0.01"},
{"Region":"B","Month":"12","Difference":"-0.02"},
{"Region":"C","Month":"1","Difference":"-0.05"},
{"Region":"C","Month":"2","Difference":"-0.04"},
{"Region":"C","Month":"3","Difference":"-0.03"},
{"Region":"C","Month":"4","Difference":"0"},
{"Region":"C","Month":"5","Difference":"0"},
{"Region":"C","Month":"6","Difference":"-0.02"},
{"Region":"C","Month":"7","Difference":"-0.05"},
{"Region":"C","Month":"8","Difference":"0.02"},
{"Region":"C","Month":"9","Difference":"0"},
{"Region":"C","Month":"10","Difference":"-0.03"},
{"Region":"C","Month":"11","Difference":"-0.03"},
{"Region":"C","Month":"12","Difference":"0.02"},
{"Region":"D","Month":"1","Difference":"0.05"},
{"Region":"D","Month":"2","Difference":"-0.02"},
{"Region":"D","Month":"3","Difference":"-0.05"},
{"Region":"D","Month":"4","Difference":"-0.05"},
{"Region":"D","Month":"5","Difference":"0"},
{"Region":"D","Month":"6","Difference":"-0.01"},
{"Region":"D","Month":"7","Difference":"0.02"},
{"Region":"D","Month":"8","Difference":"-0.01"},
{"Region":"D","Month":"9","Difference":"0"},
{"Region":"D","Month":"10","Difference":"-0.01"},
{"Region":"D","Month":"11","Difference":"0.01"},
{"Region":"D","Month":"12","Difference":"-0.03"}
]},
"mark": {
"type": "bar",
"stroke": "black",
"opacity": 1,
"cornerRadius": 2,
"tooltip":true
},
"width": 440,
"height": 75,
"cornerRadius": 2,
"encoding": {
"facet": {
"field": "Region",
"type": "ordinal",
"title": null,
"columns": 2
},
"x": {
"field": "Month",
"type": "ordinal",
"axis": {"labelAngle": 0}
},
"y": {
"field": "Difference",
"type": "quantitative",
"axis": {
"format": "0%",
"formatType": "pbiFormat"
}
},
"color": {
"condition": {
"test": "datum['Difference']<0",
"value": "#F78272"
},
"value": "#F2C80F"
},
"text": {
"field": "Difference",
"type": "quantitative"
}
}
}
Many thanks in advance!
*edit1: added desired output
*edit2: added dataset into the code
Desired outcome:
How's this?
{
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
"data": {
"values": [
{"Region": "A", "Month": "1", "Difference": "-0.01"},
{"Region": "A", "Month": "2", "Difference": "0"},
{"Region": "A", "Month": "3", "Difference": "-0.03"},
{"Region": "A", "Month": "4", "Difference": "-0.01"},
{"Region": "A", "Month": "5", "Difference": "-0.01"},
{"Region": "A", "Month": "6", "Difference": "0.05"},
{"Region": "A", "Month": "7", "Difference": "-0.05"},
{"Region": "A", "Month": "8", "Difference": "-0.03"},
{"Region": "A", "Month": "9", "Difference": "0.03"},
{"Region": "A", "Month": "10", "Difference": "-0.01"},
{"Region": "A", "Month": "11", "Difference": "-0.01"},
{"Region": "A", "Month": "12", "Difference": "0.03"},
{"Region": "B", "Month": "1", "Difference": "-0.02"},
{"Region": "B", "Month": "2", "Difference": "-0.02"},
{"Region": "B", "Month": "3", "Difference": "0.02"},
{"Region": "B", "Month": "4", "Difference": "0.03"},
{"Region": "B", "Month": "5", "Difference": "-0.05"},
{"Region": "B", "Month": "6", "Difference": "-0.02"},
{"Region": "B", "Month": "7", "Difference": "-0.01"},
{"Region": "B", "Month": "8", "Difference": "0.03"},
{"Region": "B", "Month": "9", "Difference": "-0.03"},
{"Region": "B", "Month": "10", "Difference": "-0.03"},
{"Region": "B", "Month": "11", "Difference": "0.01"},
{"Region": "B", "Month": "12", "Difference": "-0.02"},
{"Region": "C", "Month": "1", "Difference": "-0.05"},
{"Region": "C", "Month": "2", "Difference": "-0.04"},
{"Region": "C", "Month": "3", "Difference": "-0.03"},
{"Region": "C", "Month": "4", "Difference": "0"},
{"Region": "C", "Month": "5", "Difference": "0"},
{"Region": "C", "Month": "6", "Difference": "-0.02"},
{"Region": "C", "Month": "7", "Difference": "-0.05"},
{"Region": "C", "Month": "8", "Difference": "0.02"},
{"Region": "C", "Month": "9", "Difference": "0"},
{"Region": "C", "Month": "10", "Difference": "-0.03"},
{"Region": "C", "Month": "11", "Difference": "-0.03"},
{"Region": "C", "Month": "12", "Difference": "0.02"},
{"Region": "D", "Month": "1", "Difference": "0.05"},
{"Region": "D", "Month": "2", "Difference": "-0.02"},
{"Region": "D", "Month": "3", "Difference": "-0.05"},
{"Region": "D", "Month": "4", "Difference": "-0.05"},
{"Region": "D", "Month": "5", "Difference": "0"},
{"Region": "D", "Month": "6", "Difference": "-0.01"},
{"Region": "D", "Month": "7", "Difference": "0.02"},
{"Region": "D", "Month": "8", "Difference": "-0.01"},
{"Region": "D", "Month": "9", "Difference": "0"},
{"Region": "D", "Month": "10", "Difference": "-0.01"},
{"Region": "D", "Month": "11", "Difference": "0.01"},
{"Region": "D", "Month": "12", "Difference": "-0.03"}
]
},
"spec": {
"width": 440,
"height": 75,
"encoding": {
"x": {"field": "Month", "type": "ordinal", "axis": {"labelAngle": 0}},
"y": {
"field": "Difference",
"type": "quantitative",
"axis": {"format": "0%", "formatType": "pbiFormat"}
},
"color": {
"condition": {"test": "datum['Difference']<0", "value": "#F78272"},
"value": "#F2C80F"
}
},
"layer": [
{
"mark": {
"type": "bar",
"stroke": "black",
"opacity": 1,
"cornerRadius": 2,
"tooltip": true
}
},
{
"mark": {
"type": "text",
"dy": {"expr": "datum.Difference < 0 ? 10 : -10"}
},
"encoding": {"text": {"field": "Difference", "type": "quantitative"}}
}
]
},
"facet": {"field": "Region", "type": "ordinal", "title": null},
"columns": 2
}

Weird behavior with "this T"

Can someone explain the behavior of the following to me?
With a base class like this:
abstract class Foo
{
string[] members;
final:
this(this T)(T child)
{
import std.conv : to;
foreach (member; __traits(derivedMembers, T))
{
mixin("members ~= to!string(child." ~ member ~ ");\r\n");
}
}
void printMembers()
{
writeln(members);
}
}
I'd expect members to be populated with the values of the passed child type.
However the behavior is really weird.
The array members will be populated infinitely, which basically will cause the program to go out of memory.
If you change the mixin to this:
mixin("if (members.length < 20) members ~= to!string(child." ~ member ~ ");\r\n");
then you'll be able to see how the array is populated, but the values do not make sense in terms of how the code should work.
Example usage:
class Bar : Foo
{
int baba;
int caca;
this() { baba = 1; caca = 2; super(this); }
}
class Baz : Foo
{
int foo;
int bar;
int baz;
this() { foo = 100; bar = 200; baz = 300; super(this); }
}
void main()
{
auto b = new Bar();
auto a = new Baz();
b.printMembers();
a.printMembers();
b.printMembers();
}
The above code will produce an output like below:
["1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar"]
["100", "200", "300", "100", "200", "300", "100", "200", "300", "100", "200", "300", "100", "200", "300", "100", "200", "300", "100", "200", "f193.Baz", "f193.Baz", "f193.Baz", "f193.Baz", "f193.Baz", "f193.Baz"]
["1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "1", "2", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar", "f193.Bar"]
Where I would have expected something like:
["1", "2"]
["100", "200", "300"]
["1", "2"]
Why exactly does it behave like this? It looks like a bug to me, but maybe there's a reason for the behavior?
Looking at the code I see it's because the constructor is called recursive.
The simple fix is the following:
static if (member != "__ctor") mixin("members ~= to!string(child." ~ member ~ ");\r\n");

How compare 12 List's

so, i have 12 list's with Number , and i will compare it, with a Input with Number .I will that each List to compare with the input , and print the number similar with the input .
example:
input : 2 14 34 12 23 45
first list : ["2", "14", "18", "28","40", "48"]
output 2 14
my code:
w = raw_input("give number: ").split()
a1 = ["2", "14", "18", "28","40", "48"]
a2 = ["5", "9", "17", "21", "32", "49"]
a3 = ["4", "18", "19", "30", "47", "49"]
a4 = ["9", "15", "25", "28", "39", "43"]
a5 = ["8", "11", "13", "25", "39", "48"]
a6 = ["3", "12", "13", "14", "31", "33"]
a7 = ["3", "12", "14", "23", "26", "45"]
a8 = ["1", "10", "12", "15", "18", "37"]
a9 = ["6", "7", "17", "38", "41", "44"]
a10 = ["1", "7", "14", "17", "27", "35"]
a11 = ["15", "23", "25", "26", "39", "48"]
a12 = ["5", "12", "14", "30", "41", "48"]
for a,b,c,d,e,f,g,h,i,j,k,l in zip(a1, b2, c3, d4, e5, f6, g7, h8, i9, j10, k11, l12):
if a in w :
print "(1)", a
elif b in w:
print "(2)", b
elif c in w:
print "(3)", c
elif d in w:
print "(4)", d
elif e in w:
print "(5)", e
elif f in w:
print "(6)", f
elif g in w:
print "(7)", g
elif h in w:
print "(8)", h
elif i in w:
print "(9)", i
elif j in w:
print "(10)", j
elif k in w:
print "(11)", k
else:
print "(12)", a
This is what i come....
give number: 2 14 18 28
(1) 2
(1) 14
(1) 18
(1) 28
(8) 40
(12) 48
Can you Please help me.... Thanks!
People help me for this question(not here...)...very thanks them!!, The solution for my problem ... i write the solution maybe another people to need it...
bet_numbers = [
{"2", "14", "18", "28","40", "48"},
{"5", "9", "17", "21", "32", "49"},
{"4", "18", "19", "30", "47", "49"},
{"9", "15", "25", "28", "39", "43"},
{"8", "11", "13", "25", "39", "48"}, #created set Lists with curly braces {}
{"3", "12", "13", "14", "31", "33"},
{"3", "12", "14", "23", "26", "46"},
{"1", "10", "12", "15", "18", "37"},
{"6", "7", "17", "38", "41", "44"},
{"1", "7", "14", "17", "27", "35"},
{"15", "23", "25", "26", "39", "48"},
{"5", "12", "14", "30", "41", "48"},
]
drawn_numbers = set(raw_input("drawn numbers: ").split()) # build a set List
for index, numbers in enumerate(bet_numbers, start=1): #with enumerate(),enumerate each List
correct = drawn_numbers & numbers #with "identifier" add Input + numbers = (1), (2),....
if correct: #if statement without comparison because True is...
print "({}) {}".format(index, ', '.join(sorted(correct)))
#"({}) {}".format() = concatenate elements together .
# (index, ', '.join(sorted(correct))) = (1), (2),...sorted(correct),sorted the set lists output

Bruteforce Attack Project

I am creating a simple 'Bruteforce attack' for a project (not school related). Could someone please tell me which part of the code is wrong to get these errors.
The Code:
#include <string>
using namespace std;
//Password array
std::string passwordArray;
//Lowercare character array
std::string lower = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
//Uppercase character array
std::string upper = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M",
"N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
//Digits array
std::string digits = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
private void setupCharArray()
{
if (ckhLower.Checked)
{
characterArray.AddRange(lower);
}
if (chkUpper.Checked)
{
characterArray.AddRange(upper);
}
if (chkDigits.Checked)
{
characterArray.AddRange(digits);
}
}
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
brute();
}
so I try to compile this code using MinGW
g++ bruteforce.cpp -o bruteforce.exe
and I get these error messages
c:\Users\Lotty Playle\Documents>g++ bruteforce.cpp -o bruteforce.exe
bruteforce.cpp:7:66: error: in C++98 'lower' must be initialized by constructor,
not by '{...}'
bruteforce.cpp:7:66: error: could not convert '{"a", "b", "c", "d", "e", "f", "g
", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w
", "x", "y", "z"}' from '<brace-enclosed initializer list>' to 'std::string {aka
std::basic_string<char>}'
bruteforce.cpp:10:66: error: in C++98 'upper' must be initialized by constructor
, not by '{...}'
bruteforce.cpp:10:66: error: could not convert '{"A", "B", "C", "D", "E", "F", "
G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "
W", "X", "Y", "Z"}' from '<brace-enclosed initializer list>' to 'std::string {ak
a std::basic_string<char>}'
bruteforce.cpp:12:73: error: in C++98 'digits' must be initialized by constructo
r, not by '{...}'
bruteforce.cpp:12:73: error: could not convert '{"0", "1", "2", "3", "4", "5", "
6", "7", "8", "9"}' from '<brace-enclosed initializer list>' to 'std::string {ak
a std::basic_string<char>}'
bruteforce.cpp:14:1: error: expected unqualified-id before 'private'
If anyone knows what I'm doing wrong could they please show me.
L x
An array of strings should look like this: (with [])
std::string lower[] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m",
"n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
A std::string of characters would look like this:
std::string lower = "abcdefghijklmnopqrstuvwxyz";
Note that using a bunch of std::strings to represent characters is extremely inefficient. You should use a char array, or just work with ascii arithmetic.

Unable to sort a MAP in clojure on the basis of nested fields

I am trying to sort the below map( Clojure) on the basis of "col_nm" field, but unable to do so.
{:Mawb {:user_val "3", :col_nm "1"},
:HawbDate {:user_val "", :col_nm "3"},
:EtlBatchID {:user_val "1", :col_nm "2"}}
The output should be:
{:Mawb {:user_val "3", :col_nm "1"},
:EtlBatchID {:user_val "1", :col_nm "2"},
:HawbDate {:user_val "", :col_nm "3"} }
Can anyone help me, thanks in advance.
Try this one:
(def m {:Mawb {:user_val "3", :col_nm "1"},
:HawbDate {:user_val "", :col_nm "3"},
:EtlBatchID {:user_val "1", :col_nm "2"}})
(sort-by (comp :col_nm second) m)
=> ([:Mawb {:user_val "3", :col_nm "1"}]
[:EtlBatchID {:user_val "1", :col_nm "2"}]
[:HawbDate {:user_val "", :col_nm "3"}])